import React, { useState } from 'react'; import { Trash2 } from 'lucide-react'; import { useRevokeApiKey } from '../../utils/queries/apikey-queries'; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, } from '../ui/dialog'; import { Button } from '../ui/button'; import { Input, Label } from '../ui/input'; const ApiKeyRevokeModal = ({ isOpen, onClose }) => { const [apiKey, setApiKey] = useState(''); const revokeApiKeyMutation = useRevokeApiKey(); const handleRevoke = async () => { if (!apiKey.trim()) { alert('Please enter an API key'); return; } try { await revokeApiKeyMutation.mutateAsync(apiKey); alert('API key revoked successfully'); onClose(); } catch (error) { console.error('Failed to revoke API key:', error); alert('Failed to revoke API key'); } }; return ( { if (!o) onClose(); }}> Revoke API Key
setApiKey(e.target.value)} />
); }; export default ApiKeyRevokeModal;