Further Refactoring of the Settings
This commit is contained in:
parent
003e353073
commit
92f880c3f8
11 changed files with 557 additions and 496 deletions
28
app/components/settings/CheckBox.tsx
Normal file
28
app/components/settings/CheckBox.tsx
Normal file
|
@ -0,0 +1,28 @@
|
|||
import React from 'react';
|
||||
|
||||
interface CheckboxSettingProps {
|
||||
label: string; // The label to display
|
||||
checked: boolean; // The checked state of the checkbox
|
||||
setChecked: (value: boolean) => void; // Method to update the state
|
||||
}
|
||||
|
||||
const CheckboxSetting: React.FC<CheckboxSettingProps> = ({ label, checked, setChecked }) => {
|
||||
const handleCheckboxChange = () => {
|
||||
setChecked(!checked);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="settings-option">
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={checked}
|
||||
onChange={handleCheckboxChange}
|
||||
/>
|
||||
{label}
|
||||
</label>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default CheckboxSetting;
|
Loading…
Add table
Add a link
Reference in a new issue