import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../../../components/ui/dialog'; import type { Disclaimer } from '../../../config/communicationPreferences'; import './PatientSettingsPage.css'; export interface CommunicationConsentDialogProps { open: boolean; channelLabel: string; disclaimer: Disclaimer; submitting: boolean; onAgree: () => void; onClose: () => void; } // Informed-consent gate shown before turning a channel ON. No Cancel button - the dialog's X closes (= decline, // the toggle stays off). Agreeing records the disclaimer version + timestamp server-side. export function CommunicationConsentDialog({ open, channelLabel, disclaimer, submitting, onAgree, onClose, }: CommunicationConsentDialogProps) { return ( { if (!next) onClose(); }} > Enable {channelLabel} Please read and agree before we turn this on.

{disclaimer.text}

); } export default CommunicationConsentDialog;