mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 11:47:56 +01:00
17 lines
405 B
TypeScript
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;
|