veza/apps/web/src/components/settings/account/DeleteAccountConfirmModal.tsx
senke 6974c12a25 aesthetic-improvements: align spacing to 8px grid (Action 11.2.1.3)
- Created automated script (scripts/align-8px-grid.py) to align all spacing to 8px grid
- Replaced non-8px-aligned spacing: gap-3/p-3/m-3 (12px) → gap-4/p-4/m-4 (16px), gap-5/p-5/m-5 (20px) → gap-6/p-6/m-6 (24px), gap-10/p-10/m-10 (40px) → gap-12/p-12/m-12 (48px), gap-20/p-20/m-20 (80px) → gap-24/p-24/m-24 (96px)
- Preserved: 4px values (gap-1, p-1, m-1) as they may be intentional fine-tuning, responsive breakpoints (sm:, md:, lg:), test files, documentation
- Modified files across all components to ensure consistent 8px grid alignment
- Action 11.2.1.3: Align all elements to 8px grid - COMPLETE
2026-01-16 11:50:46 +01:00

101 lines
3.4 KiB
TypeScript

import React, { useState } from 'react';
import { Button } from '../../ui/button';
import { Input } from '../../ui/input';
import { X, AlertTriangle, Loader2 } from 'lucide-react';
import { useToast } from '../../../context/ToastContext';
interface DeleteAccountConfirmModalProps {
onClose: () => void;
onConfirm: () => void;
}
export const DeleteAccountConfirmModal: React.FC<
DeleteAccountConfirmModalProps
> = ({ onClose, onConfirm }) => {
const { addToast } = useToast();
const [password, setPassword] = useState('');
const [loading, setLoading] = useState(false);
const handleDelete = () => {
if (!password) {
addToast('Please enter your password to confirm', 'error');
return;
}
setLoading(true);
// Simulate API call
setTimeout(() => {
setLoading(false);
onConfirm();
}, 2000);
};
return (
<div className="fixed inset-0 z-[60] flex items-center justify-center p-4">
<div
className="absolute inset-0 bg-kodo-void/90 backdrop-blur-sm"
onClick={loading ? undefined : onClose}
></div>
<div className="relative w-full max-w-md bg-kodo-graphite border border-kodo-red rounded-xl shadow-2xl overflow-hidden animate-scaleIn">
<div className="p-4 border-b border-kodo-red/30 bg-kodo-red/10 flex justify-between items-center">
<h3 className="font-bold text-kodo-red flex items-center gap-2">
<AlertTriangle className="w-5 h-5 fill-current" /> PERMANENT
DELETION
</h3>
<button
onClick={onClose}
disabled={loading}
className="text-kodo-content-dim hover:text-white disabled:opacity-50"
>
<X className="w-5 h-5" />
</button>
</div>
<div className="p-6 space-y-4">
<p className="text-kodo-text-main text-sm">
This is the final step. Once you click delete, your account will be
queued for immediate removal. You will be logged out.
</p>
<div className="bg-kodo-ink p-4 rounded border border-kodo-steel">
<ul className="text-xs text-kodo-content-dim space-y-2 list-disc pl-4">
<li>All uploaded tracks and assets will be deleted.</li>
<li>Your username will be released.</li>
<li>Any active subscriptions will be cancelled immediately.</li>
</ul>
</div>
<div>
<label className="block text-sm font-bold text-white mb-2">
Confirm Password
</label>
<Input
type="password"
placeholder="Enter your password"
value={password}
onChange={(e) => setPassword(e.target.value)}
autoFocus
/>
</div>
</div>
<div className="p-4 border-t border-kodo-steel bg-kodo-ink flex justify-end gap-4">
<Button variant="ghost" onClick={onClose} disabled={loading}>
Cancel
</Button>
<Button
variant="primary"
className="bg-kodo-red hover:bg-kodo-red border-kodo-red text-white"
onClick={handleDelete}
disabled={loading}
>
{loading ? (
<Loader2 className="w-4 h-4 animate-spin" />
) : (
'DELETE FOREVER'
)}
</Button>
</div>
</div>
</div>
);
};