import React, { useState } from 'react';
import styles from './toggleRow.module.css';
const ToggleRow = ({ option }) => {
const [active, setActive] = useState(false);
return (
<div className={styles.toggleRow}>
{option}
<label className={styles.toggle}>
<input className={styles.toggleInput} type='checkbox' checked={active} onChange={() => setActive(!active)}/>
<span className={styles.toggleSlider}></span>
</label>
</div>
)
}
export default ToggleRow;
view raw ToggleRow.js hosted with ❤ by GitHub