import { View } from '@tarojs/components'
import './index.scss'

interface SwitchProps {
  checked: boolean
  onChange?: (checked: boolean) => void
}

export function Switch({ checked, onChange }: SwitchProps) {
  return <View className={`switch ${checked ? 'switch--checked' : ''}`} onClick={() => onChange?.(!checked)} />
}

export default Switch

