---
import { Image } from "astro:assets";
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "./ui/card";

const { post } = Astro.props;
---

<div>
  <a href={`${Astro.url.origin}/${Astro.currentLocale}/blog/${post.blog_slug}`}>
    <Card>
      <CardHeader>
        <img
          src={post.data.image.url}
          alt={post.data.image.alt}
          class="rounded-md"
          
        />
        <span class="py-2"></span>
        <CardTitle>{post.data.title}</CardTitle>
        <CardDescription>
          <p>
            {post.data.author} • {
              post.data.publishDate.toLocaleString(Astro.currentLocale)
            }
          </p>
        </CardDescription>
      </CardHeader>
      <CardContent>
        <p>{post.data.description}</p>
      </CardContent>
    </Card>
  </a>
</div>
