61 lines
2.4 KiB
TypeScript
61 lines
2.4 KiB
TypeScript
import type { DossierReportModel } from '@/lib/project-dossier-report';
|
|
import { InvestmentReportTables } from './investment-report-tables';
|
|
export function DossierReportPreview({
|
|
report,
|
|
}: {
|
|
report: DossierReportModel;
|
|
}) {
|
|
return (
|
|
<article
|
|
aria-label="Pré-visualização do relatório"
|
|
className="min-w-0 space-y-3 rounded border p-3"
|
|
>
|
|
<h3 className="font-semibold">{report.title}</h3>
|
|
<p className="text-sm">{report.version}</p>
|
|
{report.sections.map((section, i) => (
|
|
<section
|
|
key={`${section.id}-${i}`}
|
|
className="min-w-0 space-y-2"
|
|
>
|
|
<h4 className="font-medium">{section.title}</h4>
|
|
{section.paragraphs.map((p, j) => (
|
|
<p key={j}>{p}</p>
|
|
))}
|
|
{section.id !== 'finance' &&
|
|
section.id !== 'financial-report' ? (
|
|
section.rows.map((row, j) => (
|
|
<p key={j} className="break-words">
|
|
<strong>{row.field}: </strong>
|
|
{row.value}
|
|
<small className="block">
|
|
{row.classification}. {row.origin}
|
|
</small>
|
|
</p>
|
|
))
|
|
) : (
|
|
<dl className="space-y-2">
|
|
{section.rows.map((r, j) => (
|
|
<div className="break-words" key={j}>
|
|
<dt className="font-medium">{r.field}</dt>
|
|
<dd>{r.value}</dd>
|
|
<dd className="text-sm">
|
|
{r.classification} · {r.origin}
|
|
</dd>
|
|
</div>
|
|
))}
|
|
</dl>
|
|
)}
|
|
{section.tables && (
|
|
<InvestmentReportTables tables={section.tables} />
|
|
)}
|
|
</section>
|
|
))}
|
|
{report.limitations.map((p, i) => (
|
|
<p className="text-sm" key={i}>
|
|
{p}
|
|
</p>
|
|
))}
|
|
</article>
|
|
);
|
|
}
|