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
|
|
|
|
2018-10-15 06:56:17 +00:00
|
|
|
const Checkbox = ({ name, label, topLabel, ...props }) => (
|
|
|
|
<label
|
|
|
|
className={classnames('checkbox', {
|
|
|
|
'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;
|