@@ -2,6 +2,8 @@ import { Link } from '@inertiajs/react';
|
||||
import { ArrowUpRight, ClipboardList } from 'lucide-react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { openJourneyHelp } from '@/components/journey-help';
|
||||
import { recoveryHints } from '@/lib/journey-help';
|
||||
import { date, money, statusLabels } from '@/types/procurement';
|
||||
import type { Requisition } from '@/types/procurement';
|
||||
|
||||
@@ -131,7 +133,7 @@ export function RequisitionTable({ rows }: { rows: Requisition[] }) {
|
||||
<Status value={r.status} />
|
||||
</td>
|
||||
<td className="text-right font-medium whitespace-nowrap">
|
||||
{money(Number(r.total_minor))}
|
||||
{money(r.total_minor)}
|
||||
</td>
|
||||
<td className="pl-3">
|
||||
<Link
|
||||
@@ -150,6 +152,7 @@ export function RequisitionTable({ rows }: { rows: Requisition[] }) {
|
||||
}
|
||||
export function FormErrors({ errors }: { errors: Record<string, string> }) {
|
||||
if (!Object.keys(errors).length) return null;
|
||||
const hints = recoveryHints(Object.keys(errors));
|
||||
return (
|
||||
<div
|
||||
role="alert"
|
||||
@@ -161,6 +164,24 @@ export function FormErrors({ errors }: { errors: Record<string, string> }) {
|
||||
<li key={key}>{value}</li>
|
||||
))}
|
||||
</ul>
|
||||
{hints.length > 0 && (
|
||||
<div
|
||||
className="mt-3 space-y-2 text-foreground"
|
||||
role="note"
|
||||
aria-label="Orientação para corrigir"
|
||||
>
|
||||
{hints.map((hint) => (
|
||||
<p key={hint}>{hint}</p>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<button
|
||||
type="button"
|
||||
className="mt-3 underline focus-visible:ring-2 focus-visible:ring-ring"
|
||||
onClick={openJourneyHelp}
|
||||
>
|
||||
Consultar ajuda para corrigir e continuar
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user