import { Head, Link, router, useForm } from '@inertiajs/react'; import { FormErrors, PageTitle, Panel } from '@/components/procurement'; import { Button } from '@/components/ui/button'; import { Label } from '@/components/ui/label'; import { date, roleLabels } from '@/types/procurement'; type Adoption = { id: number; revision: number; admission_policy_id: number; reason: string; snapshot: { roles: string[]; required_count: number; policy_revision: number; }; }; type Proposal = { id: number; reference: string; supplier: { name: string } | null; basisHash: string | null; clear: boolean; previousId: number; }; type Review = { id: number; verdict: string; reason: string; created_at: string; snapshot: { name: string; purchasing_role: string }; }; type Decision = { id: number; revision: number; quotation_id: number; outcome: string; reason: string; status: string; current: boolean; canReview: boolean; created_at: string; snapshot: { proponent: { name: string } }; reviews: Review[]; }; type Props = { requisition: { id: number; number: string }; policy: { id: number; revision: number; enabled: boolean } | null; adoption: Adoption | null; selected: Adoption | null; adoptions: Adoption[]; proposals: Proposal[]; history: { data: Decision[]; prev_page_url: string | null; next_page_url: string | null; }; canAdopt: boolean; canPropose: boolean; closed: boolean; }; const selectClass = 'h-10 w-full rounded-md border bg-background px-3 text-sm'; const outcomes: Record = { admit: 'Admitir', exclude: 'Excluir', clarify: 'Solicitar esclarecimento interno', }; const statuses: Record = { pending: 'A aguardar conferência', confirmed: 'Decisão confirmada', returned: 'Tentativa devolvida', }; function Reason({ value, onChange, id, }: { value: string; onChange: (value: string) => void; id: string; }) { return (