diff options
| author | Bobby <[email protected]> | 2022-11-30 23:16:07 -0500 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-11-30 23:16:07 -0500 |
| commit | daaa789068cebb5fdfcea6197ade6e663be46e0f (patch) | |
| tree | 1cd315851b779ac28fe622da332c3c16fe1c433c /src/components/configuration/checkBoxWrapper.tsx | |
| download | tcssocialify-daaa789068cebb5fdfcea6197ade6e663be46e0f.tar.xz tcssocialify-daaa789068cebb5fdfcea6197ade6e663be46e0f.zip | |
socialify update
Diffstat (limited to 'src/components/configuration/checkBoxWrapper.tsx')
| -rw-r--r-- | src/components/configuration/checkBoxWrapper.tsx | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/components/configuration/checkBoxWrapper.tsx b/src/components/configuration/checkBoxWrapper.tsx new file mode 100644 index 0000000..e9dd1eb --- /dev/null +++ b/src/components/configuration/checkBoxWrapper.tsx @@ -0,0 +1,37 @@ +import ConfigType from '../../../common/types/configType' + +type CheckBoxProps = { + title: string + keyName: keyof ConfigType + checked?: boolean + disabled?: boolean + + handleChange: (value: any, key: keyof ConfigType) => void +} + +const CheckBoxWrapper = ({ + title, + keyName, + checked, + disabled, + handleChange +}: CheckBoxProps) => { + return ( + <div className="form-control"> + <label className="label cursor-pointer justify-start gap-2"> + <input + className="checkbox checkbox-sm" + type="checkbox" + checked={!!checked} + disabled={disabled} + onChange={(e) => { + handleChange({ state: e.target.checked }, keyName) + }} + /> + <span className="label-text">{title}</span> + </label> + </div> + ) +} + +export default CheckBoxWrapper |
