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.

56 lines
1.6 KiB
TypeScript

// frontend/components/inbox/SmartInbox.tsx
"use client";
import { Icon } from "@/components/Icon";
import type { Sphere, UiInboxItem } from "@/lib/types";
import CaptureComposer from "./CaptureComposer";
import CaptureRow from "./CaptureRow";
import SphereFilters from "./SphereFilters";
export default function SmartInbox({
items,
todayRouted,
filter,
onFilter,
onSubmit,
onConfirm,
onReType,
}: {
items: UiInboxItem[];
todayRouted: number;
filter: "all" | Sphere;
onFilter: (f: "all" | Sphere) => void;
onSubmit: (raw: string, kind: "text" | "voice" | "image") => void;
onConfirm: (id: string) => void;
onReType: (id: string) => void;
}) {
return (
<section className="card sbox sp2">
<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>
<CaptureComposer onSubmit={onSubmit} />
<SphereFilters filter={filter} onFilter={onFilter} />
<div className="sb-list">
{items.length === 0 ? (
<div className="sb-empty">
. .
</div>
) : (
items.map((c) => (
<CaptureRow key={c.id} item={c} onConfirm={onConfirm} onReType={onReType} />
))
)}
</div>
</section>
);
}