import { CheckCircle2 } from "lucide-react"; import { Link } from "react-router-dom"; import { cn } from "@/lib/cn"; import type { E621Post } from "@/lib/e621"; import { formatBytes } from "@/lib/format"; const ratingBorder: Record = { s: "border-ctp-green/25 hover:border-ctp-green/60", q: "border-ctp-peach/25 hover:border-ctp-peach/60", e: "border-ctp-red/25 hover:border-ctp-red/60", }; const ratingPill: Record = { s: "bg-ctp-green text-ctp-crust", q: "bg-ctp-peach text-ctp-crust", e: "bg-ctp-red text-ctp-crust", }; export function PostCard({ post, inLibrary, from, }: { post: E621Post; inLibrary: boolean; from?: string; }) { return (
{post.preview.url ? ( {`Post ) : (
No preview
)} {post.rating} {post.file.ext} {inLibrary ? ( IN ) : null}
#{post.id} ▲ {post.score.total} · {formatBytes(post.file.size)}
); }