import { router } from '@inertiajs/react'; import { useState } from 'react'; import { controlClass } from '@/components/procurement'; import { Button } from '@/components/ui/button'; import type { RegistryPerson } from '@/pages/people/registry'; export type RegistryChoice = { ready: boolean; canCreate: boolean; search: string; items: RegistryPerson[]; }; export function PeopleRegistryChoice({ processId, data, selected, choose, }: { processId: number; data: RegistryChoice; selected: string; choose: (person: RegistryPerson | null) => void; }) { const [search, setSearch] = useState(data.search); function lookup() { router.get( `/pessoas/${processId}`, { cadastro: search }, { only: ['registry'], preserveState: true, preserveScroll: true }, ); } return (
); }