import React from 'react';
import { FormControlLabel, Checkbox as MuiCheckbox } from '@mui/material';

import { CheckBoxBaseProps } from '../interfaces';

import { styled } from '@mui/material/styles';

const CheckBoxStyled = styled(MuiCheckbox)({});

export const CheckBox = ({ ...props }: CheckBoxBaseProps) => {
  
  return (
    <>
      {props.label ? (
        <FormControlLabel control={<CheckBoxStyled {...props} />} label={props.label} />
      ) : (
        <CheckBoxStyled {...props} />
      )}
    </>
  );
};
