diff --git a/app/components/settings/DropDown.tsx b/app/components/settings/DropDown.tsx index 9b0f79d..67f40ac 100644 --- a/app/components/settings/DropDown.tsx +++ b/app/components/settings/DropDown.tsx @@ -1,35 +1,39 @@ import React from 'react'; +// Define the structure of each option in the dropdown interface Option { - value: string; // The actual value to be used - label: string; // The label to display for the option + value: string; // The actual value to be used + label: string; // The label to display for the option } +// Define the props for the DropdownSetting component interface DropdownSettingProps { - label: string; // The label to display - value: string; // The current selected value - setValue: (newValue: string) => void; // The method to update the state - options: Option[]; // List of options for the dropdown + label: string; // The label to display above the dropdown + value: string; // The currently selected value + setValue: (newValue: string) => void; // Method to update the state with the new value + options: Option[]; // List of options for the dropdown } +// Functional component definition const DropdownSetting: React.FC = ({ label, value, setValue, options }) => { - const handleSelectChange = (e: React.ChangeEvent) => { - const newValue = e.target.value; - setValue(newValue); - }; + // Handler to change the selected option + const handleSelectChange = (e: React.ChangeEvent) => { + const newValue = e.target.value; // Get the new selected value + setValue(newValue); // Update the state with the new value + }; - return ( -
- - -
- ); + return ( +
{/* Container for the dropdown setting */} + {/* Display the label */} + +
+ ); }; export default DropdownSetting;