import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from "@conusai-kit/ui/primitives" // The imports applied so far. A server component: it holds no state, and every string is passed in. import type { ReactElement } from "react" import type { ImportView } from "../contract/index.js" export interface ImportListLabels { /** How many imports, already filled with the plural form. */ readonly count: string readonly caption: string readonly empty: string readonly source: string readonly status: string readonly created: string readonly updated: string readonly unchanged: string readonly refused: string } export function ImportList({ imports, labels, }: { imports: readonly ImportView[] labels: ImportListLabels }): ReactElement { return imports.length === 0 ? (

{labels.empty}

) : ( <>

{labels.count}

{labels.caption} {labels.source} {labels.status} {labels.created} {labels.updated} {labels.unchanged} {labels.refused} {imports.map((row) => ( {row.sourceName} {row.status} {row.created} {row.updated} {row.unchanged} {row.refused} ))}
) }