Skip to content

Commit

Permalink
fix: importing old settings error
Browse files Browse the repository at this point in the history
  • Loading branch information
VampireChicken12 committed Nov 30, 2023
1 parent 0a5570d commit 55b20e7
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 153 deletions.
6 changes: 2 additions & 4 deletions src/components/Inputs/Select/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ClassValue } from "clsx";
import type { ChangeEvent, Dispatch, SetStateAction } from "react";
import type { ChangeEvent } from "react";

import { useComponentVisible } from "@/hooks";
import { cn } from "@/src/utils/utilities";
Expand Down Expand Up @@ -28,11 +28,10 @@ export type SelectProps = {
onChange: (value: ChangeEvent<HTMLSelectElement>) => void;
options: SelectOption[];
selectedOption: string | undefined;
setSelectedOption: Dispatch<SetStateAction<string | undefined>>;
title: string;
};

const Select: React.FC<SelectProps> = ({ className, disabled, id, label, onChange, options, selectedOption, setSelectedOption }) => {
const Select: React.FC<SelectProps> = ({ className, disabled, id, label, onChange, options, selectedOption }) => {
const {
isComponentVisible: isSelectVisible,
ref: selectRef,
Expand All @@ -44,7 +43,6 @@ const Select: React.FC<SelectProps> = ({ className, disabled, id, label, onChang
};

const handleOptionSelect = (option: string) => {
setSelectedOption(option);
setIsSelectVisible(false);
onChange({ currentTarget: { value: option } } as ChangeEvent<HTMLSelectElement>);
};
Expand Down
Loading

0 comments on commit 55b20e7

Please sign in to comment.