'use client' import { AsyncSearchCombobox } from '@/components/campaign/AsyncSearchCombobox' import { isContactSearchQueryReady } from '@/lib/contactSearchQuery' import type { ActionPlanLeadershipOption } from '@/utilities/actionPlanLeadershipOptions' type LeadershipComboboxProps = { name?: string label: string value: ActionPlanLeadershipOption | null search: (query: string) => Promise emptyOptionLabel?: string onChange?: (option: ActionPlanLeadershipOption | null) => void } export const LeadershipCombobox = ({ name, label, value, search, emptyOptionLabel = 'Nenhuma', onChange, }: LeadershipComboboxProps) => ( { const results = await search(query) return results.map((option) => ({ id: option.id, label: option.label })) }} onChange={(option) => onChange?.(option ? { id: option.id, label: option.label } : null) } /> )