'use client'; import { useCallback } from 'react'; import Dropdown from '@/components/ui/Dropdown'; import SelectorButton from '@/components/ui/SelectorButton'; import useDropdown from '@/hooks/useDropdown'; import { LocationHead } from '@/models/library'; import { prefixes } from '@/utils/constants'; import { describeLocationHead, labelLocationHead } from '@/utils/labels'; import { LocationIcon } from '../DomainIcons'; import DropdownButton from '../ui/DropdownButton'; interface SelectLocationHeadProps { value: LocationHead; onChange: (newValue: LocationHead) => void; excluded?: LocationHead[]; } function SelectLocationHead({ value, excluded = [], onChange }: SelectLocationHeadProps) { const menu = useDropdown(); const handleChange = useCallback( (newValue: LocationHead) => { menu.hide(); onChange(newValue); }, [menu, onChange] ); return (