diff options
| author | IwanIDev <iwan@iwani.dev> | 2026-03-21 15:43:12 +0000 |
|---|---|---|
| committer | IwanIDev <iwan@iwani.dev> | 2026-03-21 15:43:12 +0000 |
| commit | 42ca90ee1f0aadaa09888f1c9627657abcd866b2 (patch) | |
| tree | a9291ad2afae2f7367924fcb8b36a36a6d79c497 /src/components/PostHeader.astro | |
| parent | c2ad94b04f290b5197a1cc80c98015be9e7b25da (diff) | |
feat: implement PostHeader component and add blog post route
Diffstat (limited to 'src/components/PostHeader.astro')
| -rw-r--r-- | src/components/PostHeader.astro | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/components/PostHeader.astro b/src/components/PostHeader.astro new file mode 100644 index 0000000..1845ec1 --- /dev/null +++ b/src/components/PostHeader.astro @@ -0,0 +1,29 @@ +--- +import { Card, CardContent, CardDescription, CardHeader } from "@/components/ui/card"; +import { Badge } from "@/components/ui/badge"; +import { Separator } from "@/components/ui/separator"; + +interface Props { + title: string; + slug: string; + description: string; + author: string; + publishDate: Date; +} + +const { title, slug, description, author, publishDate } = Astro.props as Props; +--- + +<Card className="w-full"> + <CardHeader> + <div class="flex flex-wrap gap-2"> + <Badge variant="secondary">{author}</Badge> + <Badge variant="outline">{publishDate.toLocaleDateString()}</Badge> + </div> + <h1 class="font-heading text-xl font-medium md:text-2xl" transition:name={`post-title-${slug}`}>{title}</h1> + <CardDescription>{description}</CardDescription> + </CardHeader> + <CardContent> + <Separator /> + </CardContent> +</Card> |
