mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-05 08:23:35 +00:00
87 lines
2.6 KiB
TypeScript
87 lines
2.6 KiB
TypeScript
import { Button } from '@/components/ui/button';
|
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
|
import { X, AlertTriangle, RefreshCw } from 'lucide-react';
|
|
|
|
export interface MintToRemove {
|
|
url: string;
|
|
name?: string;
|
|
}
|
|
|
|
interface RemoveMintModalProps {
|
|
isOpen: boolean;
|
|
onClose: () => void;
|
|
mintToRemove: MintToRemove | null;
|
|
onConfirm: () => void;
|
|
isLoading: boolean;
|
|
}
|
|
|
|
export function RemoveMintModal({
|
|
isOpen,
|
|
onClose,
|
|
mintToRemove,
|
|
onConfirm,
|
|
isLoading,
|
|
}: RemoveMintModalProps) {
|
|
if (!isOpen || !mintToRemove) return null;
|
|
|
|
return (
|
|
<div className="fixed inset-0 bg-black/50 flex items-center justify-center z-[100] p-4">
|
|
<Card className="w-full max-w-md border-0 shadow-lg bg-background">
|
|
<CardHeader className="relative">
|
|
<Button
|
|
onClick={onClose}
|
|
className="absolute top-2 right-2"
|
|
size="sm"
|
|
variant="ghost"
|
|
>
|
|
<X className="h-4 w-4" />
|
|
</Button>
|
|
<CardTitle className="flex items-center pr-8">
|
|
<AlertTriangle className="h-5 w-5 mr-2 text-destructive" />
|
|
Remove Mint
|
|
</CardTitle>
|
|
<CardDescription>
|
|
Are you sure you want to remove this mint from your wallet?
|
|
</CardDescription>
|
|
</CardHeader>
|
|
<CardContent className="space-y-4">
|
|
<div className="bg-muted p-4 rounded-lg border">
|
|
<div className="font-medium">{mintToRemove.name || new URL(mintToRemove.url).hostname}</div>
|
|
</div>
|
|
|
|
<div className="text-sm text-muted-foreground bg-muted/30 p-3 rounded space-y-2">
|
|
<div>⚠️ This will remove the mint and all associated data. Any tokens from this mint will no longer be accessible.</div>
|
|
<div>💡 You can always add this mint back later if needed.</div>
|
|
</div>
|
|
|
|
<div className="flex gap-2 justify-end">
|
|
<Button
|
|
variant="outline"
|
|
onClick={onClose}
|
|
>
|
|
Cancel
|
|
</Button>
|
|
<Button
|
|
variant="destructive"
|
|
onClick={onConfirm}
|
|
disabled={isLoading}
|
|
>
|
|
{isLoading ? (
|
|
<>
|
|
<RefreshCw className="h-4 w-4 mr-2 animate-spin" />
|
|
Removing...
|
|
</>
|
|
) : (
|
|
<>
|
|
<X className="h-4 w-4 mr-2" />
|
|
Remove Mint
|
|
</>
|
|
)}
|
|
</Button>
|
|
</div>
|
|
</CardContent>
|
|
</Card>
|
|
</div>
|
|
);
|
|
}
|