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 (

Data & Privacy

Request a copy of your data or permanently delete your account.

{/* Data Request */}

Request My Data

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}.

{dataRequestSuccess && (

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 && (