import React from 'react' import { Control, Controller } from 'react-hook-form' import { Container, Label, Content, ErrorMessage, SwitchFill, Row, } from './styles' interface SwitchProps { label?: string | JSX.Element control: Control name: string } const Switch: React.FC = ({ control, name, label }) => { return ( ( {label && } onChange(!value)}> {errors[name] && {errors[name].message}} )} /> ) } export default Switch