You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.7 KiB
TypeScript

// frontend/components/dashboard/InboxSummaryCard.tsx
"use client";
import Link from "next/link";
import { Icon } from "@/components/Icon";
import type { InboxRecent } from "@/lib/types";
import { MiniRow } from "./MiniRow";
const kindIcon = (k: InboxRecent["kind"]) =>
k === "voice" ? "mic" : k === "image" ? "image" : "pen";
const typeLabel = (t: string) =>
(({ task: "작업", event: "일정", idea: "아이디어" }) as Record<string, string>)[t] ?? "분류 중";
export function InboxSummaryCard({
items,
todayRouted,
}: {
items: InboxRecent[];
todayRouted: number;
}) {
return (
<section className="card">
<div className="ch">
<div className="ico">
<Icon name="inbox" />
</div>
<div className="htext">
<h3> </h3>
<div className="sub"> </div>
</div>
<span className="count"> {todayRouted}</span>
</div>
{items.length === 0 ? (
<div className="appr-empty">
<span className="ae-tick">
<Icon name="tick" w={3} />
</span>
.
</div>
) : (
<div className="mini-list">
{items.map((c) => (
<MiniRow
key={c.id}
tone={c.tone || "faint"}
icon={kindIcon(c.kind)}
text={c.raw}
sub={typeLabel(c.type)}
/>
))}
</div>
)}
<Link className="mini-cta" href="/inbox">
<Icon name="plus" />
·
</Link>
</section>
);
}