shibafu 407fd192bd Revert "Revert "Release 20200823.1100""
This reverts commit 1b5f690f4e3f58b38562d29384b571edb7aecdb3.
2020-08-30 13:57:02 +09:00

26 lines
715 B
TypeScript

import React from 'react';
type CheckboxProps = {
id: string;
name: string;
className?: string;
checked?: boolean;
onChange?: (newValue: boolean) => void;
};
export const CheckBox: React.FC<CheckboxProps> = ({ id, name, className, checked, onChange, children }) => (
<div className={`custom-control custom-checkbox ${className}`}>
<input
id={id}
name={name}
type="checkbox"
className="custom-control-input"
checked={checked}
onChange={(e) => onChange && onChange(e.target.checked)}
/>
<label className="custom-control-label" htmlFor={id}>
{children}
</label>
</div>
);