feat(whatsapp): mensajes automáticos semanales con proveedor intercambiable
- Puerto MessagingProvider con adaptadores OpenWA (MVP, QR) y Kapso (setup link de Meta + templates), elegido con WHATSAPP_PROVIDER. - Vinculación del WhatsApp del profesor en el onboarding y en Ajustes. - Job semanal (lunes 10:00 AR): recordatorio de pago y reenganche a alumnos en riesgo (cooldown 14 días), con switches por grupo. - Idempotencia por (kind, attendee, semana ISO), webhooks firmados con HMAC y deduplicados, normalización de teléfonos a E.164. - Servicio openwa en docker-compose y guía en docs/whatsapp.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,3 +7,4 @@ export { Modal, type ModalProps } from './modal'
|
||||
export { type Toast, ToastProvider, type ToastType, useToast } from './toast'
|
||||
export { Tooltip, type TooltipProps } from './tooltip'
|
||||
|
||||
export { Switch, type SwitchProps } from './switch'
|
||||
|
||||
40
apps/web/src/components/ui/switch.tsx
Normal file
40
apps/web/src/components/ui/switch.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import { cn } from '../../lib/utils'
|
||||
|
||||
export type SwitchProps = {
|
||||
checked: boolean
|
||||
onCheckedChange: (checked: boolean) => void
|
||||
disabled?: boolean
|
||||
/** Nombre accesible, cuando no hay un `<label>` asociado. */
|
||||
'aria-label'?: string
|
||||
'aria-describedby'?: string
|
||||
id?: string
|
||||
}
|
||||
|
||||
/** Interruptor on/off accesible (`role="switch"`), sin Radix. */
|
||||
export function Switch({ checked, onCheckedChange, disabled, id, ...aria }: SwitchProps) {
|
||||
return (
|
||||
<button
|
||||
id={id}
|
||||
type="button"
|
||||
role="switch"
|
||||
aria-checked={checked}
|
||||
disabled={disabled}
|
||||
onClick={() => onCheckedChange(!checked)}
|
||||
className={cn(
|
||||
'relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors',
|
||||
'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent',
|
||||
'disabled:cursor-not-allowed disabled:opacity-50',
|
||||
checked ? 'bg-accent' : 'bg-foreground/20',
|
||||
)}
|
||||
{...aria}
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className={cn(
|
||||
'inline-block size-5 rounded-full bg-white shadow transition-transform',
|
||||
checked ? 'translate-x-5' : 'translate-x-0.5',
|
||||
)}
|
||||
/>
|
||||
</button>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user