import turnosXpressTheme from "@core/app/theme/turnosXpress";
import { ThemeProvider } from "@emotion/react";
import MuiSwitch from "@mui/material/Switch";

interface SwitchProps {
    checked: boolean;
    onChange: (checked: boolean) => void;
}

export default function Switch({ checked, onChange }: SwitchProps) {
    return (
        <ThemeProvider theme={turnosXpressTheme}>
            <MuiSwitch
                checked={checked}
                onChange={(event: React.ChangeEvent<HTMLInputElement>) => {
                    onChange(event.target.checked);
                }}
                size="medium"
            />
        </ThemeProvider>
    );
}
