This commit is contained in:
@@ -13,14 +13,17 @@ import {
|
||||
} from "@/components/ui/card";
|
||||
import Avatar from "../avatar";
|
||||
import { Icons } from "../icons";
|
||||
import { Badge } from "../ui/badge";
|
||||
|
||||
function ArticleCard({
|
||||
title,
|
||||
slug,
|
||||
author,
|
||||
published,
|
||||
createdAt,
|
||||
}: Pick<Article, "title" | "slug" | "createdAt" | "author">) {
|
||||
}: Pick<Article, "title" | "slug" | "createdAt" | "author" | "published">) {
|
||||
const authorName = author?.name ?? `${appConfig.name} Team`;
|
||||
|
||||
return (
|
||||
<Link href={appRoutes.article(slug)}>
|
||||
<Card className="group flex h-full flex-col justify-between">
|
||||
@@ -37,11 +40,21 @@ function ArticleCard({
|
||||
)}
|
||||
<span className="text-sm text-muted-foreground">{authorName}</span>
|
||||
</div>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{createdAt.toLocaleDateString("de-DE", {
|
||||
dateStyle: "long",
|
||||
})}
|
||||
</p>
|
||||
<div className="flex items-center space-x-2">
|
||||
{typeof published === "boolean" && (
|
||||
<Badge
|
||||
className="size-max px-2 py-px text-xs"
|
||||
variant={published ? "outline" : "destructive"}
|
||||
>
|
||||
{published ? "Veröffentlicht" : "Draft"}
|
||||
</Badge>
|
||||
)}
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{createdAt.toLocaleDateString("de-DE", {
|
||||
dateStyle: "long",
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user