[site/seo]: add image width and height props

This commit is contained in:
khalilcodes 2022-06-02 14:04:18 +03:00
parent 3e7049c2bc
commit f7a9da04bf
1 changed files with 6 additions and 5 deletions

View File

@ -14,11 +14,12 @@ export function Latest({ posts }) {
<div className="mt-12 max-w-lg mx-auto grid gap-5 lg:grid-cols-3 lg:max-w-none"> <div className="mt-12 max-w-lg mx-auto grid gap-5 lg:grid-cols-3 lg:max-w-none">
{posts && posts.map((post) => ( {posts && posts.map((post) => (
<div key={post.title} className="flex flex-col rounded-lg shadow-lg overflow-hidden"> <div key={post.title} className="flex flex-col rounded-lg shadow-lg overflow-hidden">
<div className="flex-shrink-0"> {post.image ?
{post.image ? <img className="h-48 w-full object-cover" src={post.image} alt={post.title} /> <div className="h-48 flex-shrink-0">
: <div className="h-20 w-full bg-slate-500" /> <img className="" width="100%" height="100%" src={post.image} alt={post.title} />
} </div>
</div> : <div className="h-20 w-full bg-slate-500" />
}
<div className="flex-1 bg-slate-800 p-6 flex flex-col justify-between"> <div className="flex-1 bg-slate-800 p-6 flex flex-col justify-between">
<div className="flex-1"> <div className="flex-1">
<p className="text-sm font-medium text-indigo-600 dark:text-yellow-500"> <p className="text-sm font-medium text-indigo-600 dark:text-yellow-500">