- Replace all kodo-* color classes across ~100 TSX files: kodo-void → background, kodo-ink → card, kodo-graphite → muted, kodo-steel → muted-foreground, kodo-cyan → primary, kodo-magenta → destructive, kodo-lime → success, kodo-red → destructive, kodo-gold → warning - Replace cyan-500, magenta-500, lime-500 default Tailwind colors with semantic equivalents (primary, destructive, success) - Fix WaveformVisualizer hardcoded hex colors to SUMI values - Delete global-effects.css (conflicting, redundant with index.css) Co-authored-by: Cursor <cursoragent@cursor.com>
101 lines
3.4 KiB
TypeScript
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 '../../../components/feedback/ToastProvider';
|
|
|
|
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-background/90 backdrop-blur-sm"
|
|
onClick={loading ? undefined : onClose}
|
|
></div>
|
|
<div className="relative w-full max-w-md bg-muted border border-destructive rounded-xl shadow-2xl overflow-hidden animate-scaleIn">
|
|
<div className="p-4 border-b border-destructive/30 bg-destructive/10 flex justify-between items-center">
|
|
<h3 className="font-bold text-destructive flex items-center gap-2">
|
|
<AlertTriangle className="w-5 h-5 fill-current" /> PERMANENT
|
|
DELETION
|
|
</h3>
|
|
<button
|
|
onClick={onClose}
|
|
disabled={loading}
|
|
className="text-muted-foreground hover:text-foreground disabled:opacity-50"
|
|
>
|
|
<X className="w-5 h-5" />
|
|
</button>
|
|
</div>
|
|
|
|
<div className="p-6 space-y-4">
|
|
<p className="text-foreground 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-card p-4 rounded border border-border">
|
|
<ul className="text-xs text-muted-foreground 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-foreground 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-border bg-card flex justify-end gap-4">
|
|
<Button variant="ghost" onClick={onClose} disabled={loading}>
|
|
Cancel
|
|
</Button>
|
|
<Button
|
|
variant="primary"
|
|
className="bg-destructive hover:bg-destructive border-destructive text-white"
|
|
onClick={handleDelete}
|
|
disabled={loading}
|
|
>
|
|
{loading ? (
|
|
<Loader2 className="w-4 h-4 animate-spin" />
|
|
) : (
|
|
'DELETE FOREVER'
|
|
)}
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|