2018-05-16 03:02:48 +00:00
|
|
|
import React from 'react';
|
2018-10-15 06:56:17 +00:00
|
|
|
import classnames from 'classnames';
|
2018-05-16 03:02:48 +00:00
|
|
|
|
2020-05-12 05:48:12 +00:00
|
|
|
const Checkbox = ({ name, label, topLabel, classNameLabel, ...props }) => (
|
2018-10-15 06:56:17 +00:00
|
|
|
<label
|
2020-05-12 05:48:12 +00:00
|
|
|
className={classnames('checkbox', classNameLabel, {
|
2018-10-15 06:56:17 +00:00
|
|
|
'top-label': topLabel
|
|
|
|
})}
|
|
|
|
htmlFor={name}
|
|
|
|
>
|
|
|
|
{topLabel && label}
|
|
|
|
<input type="checkbox" id={name} name={name} {...props} />
|
|
|
|
<span />
|
|
|
|
{!topLabel && label}
|
|
|
|
</label>
|
2018-05-16 03:02:48 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
export default Checkbox;
|