import "@potzblitz/styles/lib/components/Toggle.scss"; import React, { useState, useEffect } from "react"; import { api } from "@potzblitz/components"; export function Toggle(props: api.ToggleProps) { const [vO, setVO] = useState(props.value); useEffect(() => { setVO(props.value); }, [props.value]); const handleSwitch = () => { const newValue = !vO; setVO(newValue); props.onChange && props.onChange(newValue); }; return (
{props.label && }
); }