Complete checkbox component

This commit is contained in:
Hazem Krimi
2021-04-21 23:59:56 +01:00
parent ed4f74c944
commit d0087d52ca
3 changed files with 101 additions and 4 deletions
+26 -2
View File
@@ -1,7 +1,31 @@
import { Wrapper } from './styles';
import { Text } from '..';
import { Check } from '../../assets';
const CheckBox = () => {
return <Wrapper></Wrapper>;
type CheckBoxProps = {
className?: string;
color?: 'client' | 'productOwner' | 'developer' | 'admin';
label: string;
name: string;
checked: boolean;
onChange: () => void;
};
const CheckBox = ({
label,
name,
checked,
onChange,
...props
}: CheckBoxProps) => {
return (
<Wrapper checked={checked} {...props} onClick={onChange}>
<div className='checkbox'>
<Check />
</div>
<Text variant='body'>{label}</Text>
</Wrapper>
);
};
export default CheckBox;