import React from "react";
import {Checkbox, FormControlLabel} from "@mui/material";
import {SwitchBaseProps} from "@mui/material/internal/SwitchBase";

export interface LabeledCheckboxProps {
    checked: SwitchBaseProps['checked'],
    onChange: SwitchBaseProps['onChange'],
    name: string,
    label: string,
}

function LabeledCheckbox(props: LabeledCheckboxProps) {
    return (
        <FormControlLabel
            control={
                <Checkbox
                    checked={props.checked}
                    onChange={props.onChange}
                    name={props.name}
                    color="primary"
                />
            }
            label={props.label}
        />
    );
}

export default LabeledCheckbox;