---
import Link from "@/components/Link.astro";

interface Props {
  id: string;
  date: Date;
  title: string;
  description: string;
}

const { id, date, title, description } = Astro.props;
---

<div>
  <Link href={`/posts/${id}`}>
    <h2 class="text-lg font-semibold">{title}</h2>
  </Link>
  <time class="block text-neutral-500 text-sm">
    {
      date.toLocaleDateString("en-US", {
        year: "numeric",
        month: "long",
        day: "numeric",
      })
    }
  </time>
  <p class="text-base text-neutral-400">{description}</p>
</div>
