feat(offers): complete phase five operational controls in QA
This commit is contained in:
@@ -12,12 +12,17 @@ export default function OfferPreparations({
|
||||
title: string | null;
|
||||
reference: string;
|
||||
state: string;
|
||||
availability?: string;
|
||||
}[];
|
||||
prev_page_url: string | null;
|
||||
next_page_url: string | null;
|
||||
};
|
||||
canCreate: boolean;
|
||||
filters?: { state?: string };
|
||||
filters?: {
|
||||
state?: string;
|
||||
operational?: boolean;
|
||||
pending_reports?: boolean;
|
||||
};
|
||||
}) {
|
||||
return (
|
||||
<main className="mx-auto w-full max-w-5xl space-y-6 p-4 md:p-8">
|
||||
@@ -25,7 +30,9 @@ export default function OfferPreparations({
|
||||
<header className="flex flex-wrap items-center justify-between gap-4">
|
||||
<div>
|
||||
<h1 className="text-2xl font-semibold">
|
||||
As minhas ofertas
|
||||
{filters.operational || filters.pending_reports
|
||||
? 'Ofertas — acompanhamento'
|
||||
: 'As minhas ofertas'}
|
||||
</h1>
|
||||
<p className="text-muted-foreground mt-2">
|
||||
Prepare e guarde as suas ofertas num espaço privado.
|
||||
@@ -62,6 +69,19 @@ export default function OfferPreparations({
|
||||
</Link>
|
||||
))}
|
||||
</nav>
|
||||
{filters.operational && (
|
||||
<nav
|
||||
className="flex flex-wrap gap-4"
|
||||
aria-label="Acompanhamento de ofertas"
|
||||
>
|
||||
<Link href="/minhas-oportunidades/ofertas?operational=1">
|
||||
Todas no meu âmbito
|
||||
</Link>
|
||||
<Link href="/minhas-oportunidades/ofertas?operational=1&pending_reports=1">
|
||||
Denúncias pendentes
|
||||
</Link>
|
||||
</nav>
|
||||
)}
|
||||
{!records.data.length && (
|
||||
<p>Ainda não existem ofertas neste âmbito.</p>
|
||||
)}
|
||||
@@ -77,6 +97,24 @@ export default function OfferPreparations({
|
||||
<p className="text-muted-foreground mt-1 text-sm">
|
||||
{record.reference} ·{' '}
|
||||
{offerStates[record.state] ?? record.state}
|
||||
{record.availability && (
|
||||
<>
|
||||
{' '}
|
||||
·{' '}
|
||||
{
|
||||
(
|
||||
{
|
||||
available: 'Disponível',
|
||||
withdrawn: 'Retirada',
|
||||
expired: 'Expirada',
|
||||
revalidation:
|
||||
'Aguarda nova validação',
|
||||
unavailable: 'Indisponível',
|
||||
} as Record<string, string>
|
||||
)[record.availability]
|
||||
}
|
||||
</>
|
||||
)}
|
||||
</p>
|
||||
</li>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user