diff --git a/src/pages/LogsPage/SwitchComponent.tsx b/src/pages/LogsPage/SwitchComponent.tsx index 3170dabe..f0ffb25e 100644 --- a/src/pages/LogsPage/SwitchComponent.tsx +++ b/src/pages/LogsPage/SwitchComponent.tsx @@ -1,24 +1,31 @@ -import { Switch } from "tamagui" +import { Switch } from 'tamagui' +type SwitchComponentProps = { + timestamps: boolean + setTimestamps: (timestamps: boolean) => void +} -const SwitchComponent = () => { +const SwitchComponent = ({ timestamps, setTimestamps }: SwitchComponentProps) => { + const handleCheckedChange = () => { + setTimestamps(!timestamps) + } return ( (console.log(a))} + style={{ backgroundColor: timestamps ? '#4360df' : 'grey', border: 'none' }} + checked={timestamps} + onCheckedChange={handleCheckedChange} > ) } -export default SwitchComponent \ No newline at end of file +export default SwitchComponent