Skip to content

Commit

Permalink
refactor: deleted commented out
Browse files Browse the repository at this point in the history
  • Loading branch information
me-liu committed Dec 8, 2024
1 parent 3383127 commit 32b0afd
Showing 1 changed file with 0 additions and 68 deletions.
68 changes: 0 additions & 68 deletions components/InputDropdown/InputDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,73 +52,6 @@ function AnimatedMenu(props: MenuProps<DropdownOption>) {
</AnimatedWrapper>
);
}

// main dropdown component
// export default function InputDropdown({
// label,
// options,
// placeholder = '',
// error = '',
// disabled,
// required,
// onChange,
// multi,
// }: InputDropdownProps) {
// const optionsArray = useMemo(
// () =>
// options instanceof Set
// ? Array.from(options).map(v => ({ label: v, value: v }))
// : Array.from(options.entries()).map(([k, v]) => ({
// value: k,
// label: v,
// })),
// [options],
// );

// const handleChange = useCallback(
// (newValue: MultiValue<DropdownOption> | SingleValue<DropdownOption>) => {
// if (multi && newValue instanceof Array) {
// onChange?.(new Set(newValue.map(v => v.value)));
// } else if (!multi && !(newValue instanceof Array)) {
// onChange?.(newValue ? newValue.value : null);
// } else {
// throw new Error('An unexpected error occurred!');
// }
// },
// [multi, onChange],
// );

// return (
// <DropdownWrapper>
// <InputLabel>
// <P $color={COLORS.gray11} $fontWeight={400}>
// {label}
// </P>
// {required && <SMALL $color={COLORS.rose10}>{'*'}</SMALL>}
// </InputLabel>
// <Select
// components={{ Menu: AnimatedMenu }}
// isClearable
// closeMenuOnSelect={false}
// tabSelectsValue={false}
// hideSelectedOptions={false}
// noOptionsMessage={NoOptionsMessage}
// unstyled
// required={required}
// isDisabled={disabled}
// styles={DropdownStyles(multi, error !== '')}
// instanceId={useId()}
// options={optionsArray}
// placeholder={placeholder}
// isMulti={multi}
// onChange={handleChange}
// value={}
// />
// {error && <SMALL $color={COLORS.rose10}>{error}</SMALL>}
// </DropdownWrapper>
// );
// }

export default function InputDropdown({
label,
options,
Expand All @@ -141,7 +74,6 @@ export default function InputDropdown({
[options],
);

// Transform value into the format expected by react-select
const transformedValue = useMemo(() => {
if (multi) {
return Array.from(value).map(v => ({
Expand Down

0 comments on commit 32b0afd

Please sign in to comment.