import { Form } from "react-router"; import { useState } from "react"; import { Button } from "~/components/ui/button"; import { Label } from "~/components/ui/label"; import { Textarea } from "~/components/ui/textarea"; import { AlertDialog, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertDialogCancel, } from "~/components/ui/alert-dialog"; type Props = { userEmail: string; dataRequestCooldownUntil: Date | null; dataRequestSuccess?: boolean; dataRequestError?: string; }; export function PrivacySection({ userEmail, dataRequestCooldownUntil, dataRequestSuccess, dataRequestError, }: Props) { const [confirmed, setConfirmed] = useState(false); const [dialogOpen, setDialogOpen] = useState(false); const handleDialogOpenChange = (open: boolean) => { setDialogOpen(open); if (!open) setConfirmed(false); }; const inCooldown = dataRequestCooldownUntil !== null && dataRequestCooldownUntil > new Date(); return (
Request a copy of your data or permanently delete your account.
Under GDPR and CCPA you have the right to a copy of all personal data we hold about you. We will respond within 30 days to{" "} {userEmail}.
Request received. We'll email you within 30 days.
)} {dataRequestError && ({dataRequestError}
)} {inCooldown && !dataRequestSuccess && (Your data request is being processed. You can submit another request after {dataRequestCooldownUntil?.toLocaleDateString()}.
)} {!dataRequestSuccess && !inCooldown && ( )}Permanently remove your personal information from Brackt. Your leagues and draft history will be preserved but your name, email, and avatar will be wiped. This action cannot be undone.