blob: f956b6d6b05ea2a813dff0e59f96cf372d774fde (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import React from 'react';
import PropTypes from 'prop-types';
import s0 from 'c/Switch.module.scss';
const noop = () => {};
function Switch({ checked = false, onChange = noop, name = '' }) {
return (
<div>
<input
type="checkbox"
name={name}
checked={checked}
className={s0.switch}
onChange={onChange}
/>
</div>
);
}
Switch.propTypes = {
checked: PropTypes.bool,
onChange: PropTypes.func,
name: PropTypes.string
};
export default React.memo(Switch);
|