import { Link } from '@inertiajs/react'; import type { ProcurementGroup } from '@/lib/procurement-navigation'; export function ProcurementMenuResults({ groups, dashboard, onNavigate, onEscape, }: { groups: ProcurementGroup[]; dashboard: boolean; onNavigate: () => void; onEscape: () => void; }) { const count = groups.reduce( (total, group) => total + group.entries.length, dashboard ? 1 : 0, ); const linkClass = 'block rounded-md px-3 py-2 text-sm hover:bg-accent focus-visible:bg-accent focus-visible:outline-2 focus-visible:outline-ring'; return (
{ if (event.key === 'Escape') { event.preventDefault(); onEscape(); } }} className="absolute top-full left-0 z-50 mt-2 max-h-[min(65vh,32rem)] w-[min(36rem,calc(100vw-2rem))] overflow-y-auto rounded-xl border bg-popover p-2 text-popover-foreground shadow-lg" >

{count ? `${count} ${count === 1 ? 'opção disponível' : 'opções disponíveis'}.` : 'Nenhuma opção encontrada. Tente outra palavra.'}

{dashboard && ( Painel inicial )} {groups.map((group) => (

{group.label}

))}
); }