@@ -0,0 +1,58 @@
|
||||
import { Panel } from '@/components/procurement';
|
||||
|
||||
export type FrozenImportTariff = {
|
||||
record_id: number;
|
||||
version: number;
|
||||
item: { description: string; quantity: string; unit: string };
|
||||
data: {
|
||||
proposed_code: string | null;
|
||||
confirmed_code: string;
|
||||
source_reference: string | null;
|
||||
confirmation_source: string;
|
||||
deviation: boolean;
|
||||
};
|
||||
confirmed_by: { name: string };
|
||||
reason: string;
|
||||
};
|
||||
export default function ImportTariffSummary({
|
||||
records,
|
||||
}: {
|
||||
records?: Record<number, FrozenImportTariff>;
|
||||
}) {
|
||||
if (!records || !Object.keys(records).length) return null;
|
||||
return (
|
||||
<Panel title="Classificação pautal preservada na emissão">
|
||||
<div className="grid gap-4">
|
||||
{Object.values(records).map((record) => (
|
||||
<dl
|
||||
key={record.record_id}
|
||||
className="rounded border p-3 text-sm"
|
||||
>
|
||||
<dt className="font-medium">
|
||||
{record.item.description}
|
||||
</dt>
|
||||
<dd>
|
||||
Código confirmado: {record.data.confirmed_code} ·
|
||||
versão {record.version} · {record.confirmed_by.name}
|
||||
</dd>
|
||||
<dt>Proposta e fonte</dt>
|
||||
<dd>
|
||||
{record.data.proposed_code ?? 'Não indicada'} ·{' '}
|
||||
{record.data.source_reference ?? 'Por completar'}
|
||||
</dd>
|
||||
<dt>Fonte da confirmação</dt>
|
||||
<dd>{record.data.confirmation_source}</dd>
|
||||
<dt>
|
||||
{record.data.deviation
|
||||
? 'Justificação do desvio'
|
||||
: 'Motivo'}
|
||||
</dt>
|
||||
<dd className="break-words whitespace-pre-wrap">
|
||||
{record.reason}
|
||||
</dd>
|
||||
</dl>
|
||||
))}
|
||||
</div>
|
||||
</Panel>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user