QuickZapSwitch.tsx raw

   1  import { Label } from '@/components/ui/label'
   2  import { Switch } from '@/components/ui/switch'
   3  import { useZap } from '@/providers/ZapProvider'
   4  import { useTranslation } from 'react-i18next'
   5  
   6  export default function QuickZapSwitch() {
   7    const { t } = useTranslation()
   8    const { quickZap, updateQuickZap } = useZap()
   9  
  10    return (
  11      <div className="w-full flex justify-between items-center">
  12        <Label htmlFor="quick-zap-switch">
  13          <div className="text-base font-medium">{t('Quick zap')}</div>
  14          <div className="text-muted-foreground text-sm">
  15            {t('If enabled, you can zap with a single click. Click and hold for custom amounts')}
  16          </div>
  17        </Label>
  18        <Switch id="quick-zap-switch" checked={quickZap} onCheckedChange={updateQuickZap} />
  19      </div>
  20    )
  21  }
  22