feat: integrate private offers with existing editorial workflow

This commit is contained in:
2026-11-14 16:20:30 +02:00
parent 6e302db62e
commit 91c1857368
19 changed files with 1353 additions and 30 deletions
@@ -1,8 +1,10 @@
import { Head, Link } from '@inertiajs/react';
import { offerStates } from '@/lib/offer-editorial';
export default function OfferPreparations({
records,
canCreate,
filters = {},
}: {
records: {
data: {
@@ -15,6 +17,7 @@ export default function OfferPreparations({
next_page_url: string | null;
};
canCreate: boolean;
filters?: { state?: string };
}) {
return (
<main className="mx-auto w-full max-w-5xl space-y-6 p-4 md:p-8">
@@ -37,6 +40,28 @@ export default function OfferPreparations({
</Link>
)}
</header>
<nav
aria-label="Filtrar ofertas por estado"
className="flex flex-wrap gap-3 text-sm"
>
<Link
href="/minhas-oportunidades/ofertas"
aria-current={!filters.state ? 'page' : undefined}
>
Todas
</Link>
{Object.entries(offerStates).map(([state, label]) => (
<Link
key={state}
href={`/minhas-oportunidades/ofertas?state=${state}`}
aria-current={
filters.state === state ? 'page' : undefined
}
>
{label}
</Link>
))}
</nav>
{!records.data.length && (
<p>Ainda não existem ofertas neste âmbito.</p>
)}
@@ -51,9 +76,7 @@ export default function OfferPreparations({
</Link>
<p className="text-muted-foreground mt-1 text-sm">
{record.reference} ·{' '}
{record.state === 'submitted'
? 'Submissão privada registada'
: 'Rascunho privado'}
{offerStates[record.state] ?? record.state}
</p>
</li>
))}