'use client'; import clsx from 'clsx'; import { useCallback } from 'react'; import { IconFolderTree } from '@/components/Icons'; import { CProps } from '@/components/props'; import Dropdown from '@/components/ui/Dropdown'; import MiniButton from '@/components/ui/MiniButton'; import useDropdown from '@/hooks/useDropdown'; import { prefixes } from '@/utils/constants'; import SelectLocation from './SelectLocation'; interface SelectLocationContextProps extends CProps.Styling { value: string; onChange: (newValue: string) => void; title?: string; stretchTop?: boolean; } function SelectLocationContext({ value, title = 'Проводник...', onChange, className, style }: SelectLocationContextProps) { const menu = useDropdown(); const handleClick = useCallback( (event: CProps.EventMouse, newValue: string) => { event.preventDefault(); event.stopPropagation(); menu.hide(); onChange(newValue); }, [menu, onChange] ); return (