20 lines
837 B
TypeScript
20 lines
837 B
TypeScript
import { Card } from "@/components/ui/Card";
|
|
|
|
interface ItemCardProps {
|
|
item: { id: string; title: string; description?: string; status?: string; updatedAt?: string };
|
|
onClick?: () => void;
|
|
}
|
|
|
|
export function ItemCard({ item, onClick }: ItemCardProps) {
|
|
return (
|
|
<Card onClick={onClick}>
|
|
<h3 className="font-medium text-gray-800 truncate">{item.title || "无标题"}</h3>
|
|
<p className="text-sm text-gray-500 mt-1 line-clamp-2">{item.description?.slice(0, 120) || "无描述"}</p>
|
|
<div className="flex items-center gap-2 mt-2">
|
|
{item.status && <span className="text-xs px-1.5 py-0.5 bg-blue-100 text-blue-600 rounded">{item.status}</span>}
|
|
{item.updatedAt && <span className="text-xs text-gray-400">{new Date(item.updatedAt).toLocaleDateString("zh-CN")}</span>}
|
|
</div>
|
|
</Card>
|
|
);
|
|
}
|