diff --git a/components/SwitchTableField/index.scss b/components/SwitchTableField/index.scss new file mode 100644 index 00000000..e69de29b diff --git a/components/SwitchTableField/index.tsx b/components/SwitchTableField/index.tsx new file mode 100644 index 00000000..02e69f2f --- /dev/null +++ b/components/SwitchTableField/index.tsx @@ -0,0 +1,47 @@ +import { useEffect, useState } from 'react' +import Switch from '~components/Switch' +import TableField from '~components/TableField' + +import './index.scss' + +interface Props { + name: string + label: string + description?: string + value?: boolean + className?: string + imageAlt?: string + imageClass?: string + imageSrc?: string[] +} + +const SwitchTableField = (props: Props) => { + const [value, setValue] = useState(false) + + useEffect(() => { + if (props.value) setValue(props.value) + }, [props.value]) + + function onValueChange(value: boolean) { + setValue(value) + } + + return ( + + + + ) +} + +export default SwitchTableField