"use client"; import { useState } from "react"; import { api, errorText } from "@/lib/api"; /** GDPR: download all data, delete the account. */ export function AccountData() { const [confirm, setConfirm] = useState(false); const [typed, setTyped] = useState(""); const [busy, setBusy] = useState(false); const [error, setError] = useState(null); async function remove() { setBusy(true); setError(null); try { await api("/me", { method: "DELETE", body: { confirm: "DELETE" } }); window.location.href = "/belepes"; } catch (e) { setError(errorText(e)); setBusy(false); } } return (
Adataim letöltése Minden adatod egy JSON-fájlban: fiók, képletek, elemzések, vásárlások.
{confirm ? (

A fiókod végleg törlődik a képleteiddel, a felvett személyekkel és az összes elemzéssel együtt. Ez nem vonható vissza. A megerősítéshez írd be: TÖRLÉS

setTyped(e.target.value)} aria-label="Írd be: TÖRLÉS" autoComplete="off" />
{error && (

{error}

)}
) : (
)}
); }