commit compras1 2911
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-29 05:28:30 +02:00
parent 1ddabbbdcc
commit 448948a487
137 changed files with 9481 additions and 1926 deletions
@@ -0,0 +1,60 @@
import { Link } from '@inertiajs/react';
export type RelatedProcess = { id: number; number: string; href: string };
/** Links supplied by the native page; the server retains authority over every destination. */
export function OrderDocumentLinks({
receiptsHref = null,
financialDocumentsHref = null,
relatedProcesses = [],
}: {
receiptsHref?: string | null;
financialDocumentsHref?: string | null;
relatedProcesses?: RelatedProcess[];
}) {
if (
!receiptsHref &&
!financialDocumentsHref &&
relatedProcesses.length === 0
)
return null;
return (
<nav
aria-label="Documentos relacionados da ordem"
className="rounded-xl border bg-card p-4"
>
<ul className="flex flex-wrap gap-x-6 gap-y-3 text-sm font-medium">
{relatedProcesses.map((process) => (
<li key={process.id}>
<Link
className="underline underline-offset-4"
href={process.href}
>
Processo {process.number}
</Link>
</li>
))}
{receiptsHref && (
<li>
<Link
className="underline underline-offset-4"
href={receiptsHref}
>
Recepções, qualidade e quantidades pendentes
</Link>
</li>
)}
{financialDocumentsHref && (
<li>
<Link
className="underline underline-offset-4"
href={financialDocumentsHref}
>
Facturas e pagamentos desta ordem
</Link>
</li>
)}
</ul>
</nav>
);
}