@@ -0,0 +1,54 @@
|
||||
import { Panel } from '@/components/procurement';
|
||||
|
||||
export type FrozenCapitalAssignment = {
|
||||
id: number;
|
||||
version: number;
|
||||
reason: string;
|
||||
snapshot: {
|
||||
item: { description: string };
|
||||
source: {
|
||||
version: number;
|
||||
data: {
|
||||
type: string;
|
||||
code: string;
|
||||
name: string;
|
||||
reference: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
export default function CapitalAssignmentSummary({
|
||||
records,
|
||||
}: {
|
||||
records?: Record<number, FrozenCapitalAssignment>;
|
||||
}) {
|
||||
const rows = Object.values(records ?? {});
|
||||
if (!rows.length) return null;
|
||||
return (
|
||||
<Panel
|
||||
title="Projectos e imobilizado"
|
||||
description="Referências preservadas na emissão desta ordem."
|
||||
>
|
||||
{rows.map((row) => (
|
||||
<article
|
||||
key={row.id}
|
||||
className="space-y-2 border-b py-3 break-words"
|
||||
>
|
||||
<h3 className="font-semibold">
|
||||
{row.snapshot.item.description}
|
||||
</h3>
|
||||
<p>
|
||||
{row.snapshot.source.data.type === 'project'
|
||||
? 'Projecto'
|
||||
: 'Imobilizado'}{' '}
|
||||
· {row.snapshot.source.data.code} ·{' '}
|
||||
{row.snapshot.source.data.name} · versão{' '}
|
||||
{row.snapshot.source.version}
|
||||
</p>
|
||||
<p>{row.snapshot.source.data.reference}</p>
|
||||
<p>{row.reason}</p>
|
||||
</article>
|
||||
))}
|
||||
</Panel>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user