diff --git a/src/components/common/Dropdown.tsx b/src/components/common/Dropdown.tsx index b30afea7..25d3815a 100644 --- a/src/components/common/Dropdown.tsx +++ b/src/components/common/Dropdown.tsx @@ -7,21 +7,21 @@ import { } from 'react'; import Down from '@/assets/icons/dropdown.svg'; -interface DropdownProps { - options: string[]; - selected: string; - setSelect: Dispatch>; // Dispatch>는 set함수 타입 +interface DropdownProps { + options: readonly T[]; + selected: T; + setSelect: Dispatch>; // Dispatch>는 set함수 타입 placeholder?: string; variant: 'form' | 'filter'; } -export default function Dropdown({ +export default function Dropdown({ options, selected, setSelect, placeholder = '선택', variant, -}: DropdownProps) { +}: DropdownProps) { const [isOpen, setIsOpen] = useState(false); const dropdownRef = useRef(null); @@ -33,7 +33,7 @@ export default function Dropdown({ setIsOpen(false); }; - const handleSelect = (options: string) => { + const handleSelect = (options: T) => { setSelect(options); closeDropdown(); };