{"version":3,"file":"TabAsetukset.sFoR45iW.js","sources":["../../src/components/switches/HasBetoniSwitch.jsx","../../src/components/switches/HasLattiaSwitch.jsx","../../src/components/switches/HasPumppuSwitch.jsx","../../src/components/switches/IsTarjousSwitch.jsx","../../src/pages/steps/StepTilaus/TabAsetukset/TabAsetukset.jsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\r\n\r\nimport { allowChangeHasBetoni } from \"src/data/ifs/allowIfs\";\r\nimport MySwitch from \"src/components/MySwitch/MySwitch\";\r\nimport { useKeikkaData } from \"src/context/KeikkaDataContext\";\r\nimport { useUserData } from \"src/context/userContext\";\r\n\r\nexport default function HasBetoniaSwitch() {\r\n const { token } = useUserData();\r\n const { keikkaData } = useKeikkaData();\r\n\r\n const [isChecked, setIsChecked] = useState(false);\r\n\r\n useEffect(() => {\r\n const _hasBetonia = keikkaData.modules.hasBetoni;\r\n setIsChecked(_hasBetonia);\r\n }, []);\r\n\r\n const onChange = (e) => {\r\n const _isChecked = e.target.checked;\r\n const _hasBetonia = _isChecked;\r\n // if is checked then is not tarjous\r\n keikkaData.modules.hasBetoni = _hasBetonia;\r\n keikkaData.modules.saveModulesToDB(token);\r\n };\r\n\r\n return (\r\n