33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import type { ContextReference } from '@/lib/investor-context';
|
|
|
|
export default function ContextDocuments({
|
|
source,
|
|
}: {
|
|
source?: ContextReference;
|
|
}) {
|
|
if (!source?.documents?.length) return null;
|
|
return (
|
|
<section
|
|
aria-label="Documentos de apoio"
|
|
className="space-y-2 rounded border p-4"
|
|
>
|
|
<h2 className="font-semibold">Documentos de apoio</h2>
|
|
{(source.documents ?? []).map((doc) => (
|
|
<article
|
|
key={doc.support_id}
|
|
className="space-y-1 rounded border p-3"
|
|
>
|
|
<p>
|
|
{doc.title}{doc.edition ? ` · ${doc.edition}` : ''}
|
|
</p>
|
|
{doc.section && <p>Referência utilizada: {doc.section}</p>}
|
|
<a className="underline" href={doc.download_url}>
|
|
Consultar documento —{' '}
|
|
{doc.edition ?? doc.title}
|
|
</a>
|
|
</article>
|
|
))}
|
|
</section>
|
|
);
|
|
}
|