import {
  Switch
} from "@progress/kendo-react-inputs";
import withValidations from "../../../hoc/withValidations";
import withToolTip from "../../../hoc/withToolTip";
import withHelperText from "../../../hoc/withHelperText";
import withLabel from "../../../hoc/withLabel";
import { Style } from "../../DomainProps";

type SwitchViewProps = {
   widgetStyle?: Style;
  size:"small"|"medium"|"large",
  value?:boolean,
  onChange:(value:boolean) => void;
}
const SwitchView = (props:SwitchViewProps)=>{
    return <Switch
    id={props?.widgetStyle?.id}
    className={props?.widgetStyle?.className}
    size={props.size}
    checked={props.value !== undefined ? props.value : false}
    onChange={(e)=>props.onChange(e.value)}
    />
}

export default withValidations(
  withToolTip(withHelperText(withLabel(SwitchView)))
);