All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m51s
47 new i18n keys added across all 13 locales (en, fr, es, de, pt, it, nl, ru, ja, ko, zh, ar, fa). English and French are fully translated, remaining locales use French as placeholder. Files migrated: - EditGlossaryDialog.tsx (18 strings) - DeleteGlossaryDialog.tsx (7 strings) - ProUpgradePrompt.tsx (10 strings) - WebhookSnippet.tsx (4 strings) - TranslationModeToggle.tsx (8 strings) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
78 lines
2.2 KiB
TypeScript
78 lines
2.2 KiB
TypeScript
'use client';
|
|
|
|
import { AlertTriangle } from 'lucide-react';
|
|
import {
|
|
Dialog,
|
|
DialogContent,
|
|
DialogDescription,
|
|
DialogFooter,
|
|
DialogHeader,
|
|
DialogTitle,
|
|
} from '@/components/ui/dialog';
|
|
import { Button } from '@/components/ui/button';
|
|
import { useI18n } from '@/lib/i18n';
|
|
|
|
interface DeleteGlossaryDialogProps {
|
|
open: boolean;
|
|
onOpenChange: (open: boolean) => void;
|
|
onConfirm: () => void;
|
|
isDeleting: boolean;
|
|
glossaryName?: string;
|
|
}
|
|
|
|
export function DeleteGlossaryDialog({
|
|
open,
|
|
onOpenChange,
|
|
onConfirm,
|
|
isDeleting,
|
|
glossaryName,
|
|
}: DeleteGlossaryDialogProps) {
|
|
const { t } = useI18n();
|
|
return (
|
|
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
<DialogContent className="sm:max-w-md">
|
|
<DialogHeader>
|
|
<DialogTitle>{t('glossaries.delete.title')}</DialogTitle>
|
|
<DialogDescription>
|
|
{t('glossaries.delete.description')}
|
|
{glossaryName && (
|
|
<span className="block mt-1 font-medium text-foreground">
|
|
"{glossaryName}"
|
|
</span>
|
|
)}
|
|
</DialogDescription>
|
|
</DialogHeader>
|
|
|
|
<div className="rounded-lg border border-destructive/50 bg-destructive/10 p-4">
|
|
<div className="flex items-start gap-3">
|
|
<AlertTriangle className="h-5 w-5 text-destructive shrink-0 mt-0.5" />
|
|
<div className="space-y-1">
|
|
<p className="text-sm font-medium text-destructive">{t('glossaries.delete.warning')}</p>
|
|
<p className="text-sm text-muted-foreground">
|
|
{t('glossaries.delete.warningDesc')}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<DialogFooter>
|
|
<Button
|
|
variant="outline"
|
|
onClick={() => onOpenChange(false)}
|
|
disabled={isDeleting}
|
|
>
|
|
{t('glossaries.delete.cancel')}
|
|
</Button>
|
|
<Button
|
|
variant="destructive"
|
|
onClick={onConfirm}
|
|
disabled={isDeleting}
|
|
>
|
|
{isDeleting ? t('glossaries.delete.deleting') : t('glossaries.delete.deleteBtn')}
|
|
</Button>
|
|
</DialogFooter>
|
|
</DialogContent>
|
|
</Dialog>
|
|
);
|
|
}
|