Files
astuto/app/javascript/components/common/Switch.tsx
Riccardo Graziosi 8e75a85873 Refactor CSS (#116)
Refactor CSS files and structure. Also refactors some html and React components for a smarter use of CSS classes.
2022-06-08 10:20:36 +02:00

17 lines
405 B
TypeScript

import * as React from 'react';
interface Props {
label?: string;
onClick: React.MouseEventHandler;
checked?: boolean;
htmlId?: string;
}
const Switch = ({ label, onClick, checked, htmlId }: Props) => (
<div className="checkboxSwitch">
<input type="checkbox" id={htmlId} onClick={onClick} checked={checked} />
<label htmlFor={htmlId}>{label}</label>
</div>
);
export default Switch;