-
Notifications
You must be signed in to change notification settings - Fork 372
/
CheckBox.jsx
29 lines (27 loc) · 794 Bytes
/
CheckBox.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// @vendors
import React from 'react'
// @components
import Divider from '../Divider/Divider'
// @media
import CheckMark from './Media/CheckMark'
// @styles
import './CheckBox.css'
// ─────────────── ∞ ───────────────
export default function CheckBox({ name, label, hint, onChange, isChecked, disabled }) {
return (
<button
className={isChecked ? 'lcsgrz-cb-container-checked' : 'lcsgrz-cb-container-unchecked'}
type='button'
onClick={onChange}
disabled={disabled}
name={name}
>
<div className='lcsgrz-cb-label-box'>
<label>{label}</label>
<Divider width={10} />
<label className='lcsgrz-cb-hint'>{hint}</label>
</div>
{isChecked && <CheckMark size={15} color='white' />}
</button>
)
}