diff --git a/src/app/(dashboard)/dashboard/combos/page.tsx b/src/app/(dashboard)/dashboard/combos/page.tsx index f0ac3c7a5a..8fc3729e3a 100644 --- a/src/app/(dashboard)/dashboard/combos/page.tsx +++ b/src/app/(dashboard)/dashboard/combos/page.tsx @@ -14,6 +14,7 @@ import { } from "@/shared/components"; import { useCopyToClipboard } from "@/shared/hooks/useCopyToClipboard"; import { useNotificationStore } from "@/store/notificationStore"; +import { useTranslations } from "next-intl"; // Validate combo name: letters, numbers, -, _, /, . const VALID_NAME_REGEX = /^[a-zA-Z0-9_/.-]+$/; @@ -34,6 +35,8 @@ function getModelString(entry) { // Main Page // ───────────────────────────────────────────── export default function CombosPage() { + const t = useTranslations("combos"); + const tc = useTranslations("common"); const [combos, setCombos] = useState([]); const [loading, setLoading] = useState(true); const [showCreateModal, setShowCreateModal] = useState(false); @@ -91,13 +94,13 @@ export default function CombosPage() { if (res.ok) { await fetchData(); setShowCreateModal(false); - notify.success("Combo created successfully"); + notify.success(t("comboCreated")); } else { const err = await res.json(); - notify.error(err.error?.message || err.error || "Failed to create combo"); + notify.error(err.error?.message || err.error || t("failedCreate")); } } catch (error) { - notify.error("Error creating combo"); + notify.error(t("errorCreating")); } }; @@ -111,26 +114,26 @@ export default function CombosPage() { if (res.ok) { await fetchData(); setEditingCombo(null); - notify.success("Combo updated successfully"); + notify.success(t("comboUpdated")); } else { const err = await res.json(); - notify.error(err.error?.message || err.error || "Failed to update combo"); + notify.error(err.error?.message || err.error || t("failedUpdate")); } } catch (error) { - notify.error("Error updating combo"); + notify.error(t("errorUpdating")); } }; const handleDelete = async (id) => { - if (!confirm("Delete this combo?")) return; + if (!confirm(t("deleteConfirm"))) return; try { const res = await fetch(`/api/combos/${id}`, { method: "DELETE" }); if (res.ok) { setCombos(combos.filter((c) => c.id !== id)); - notify.success("Combo deleted"); + notify.success(t("comboDeleted")); } } catch (error) { - notify.error("Error deleting combo"); + notify.error(t("errorDeleting")); } }; @@ -166,8 +169,8 @@ export default function CombosPage() { const data = await res.json(); setTestResults(data); } catch (error) { - setTestResults({ error: "Test request failed" }); - notify.error("Test request failed"); + setTestResults({ error: t("testFailed") }); + notify.error(t("testFailed")); } }; @@ -186,7 +189,7 @@ export default function CombosPage() { setCombos((prev) => prev.map((c) => (c.id === combo.id ? { ...c, isActive: !newActive } : c)) ); - notify.error("Failed to toggle combo"); + notify.error(t("failedToggle")); } }; @@ -204,13 +207,11 @@ export default function CombosPage() { {/* Header */}
- Create model combos with weighted routing and fallback support -
+{t("description")}
- Letters, numbers, -, _, / and . allowed -
+{t("nameHint")}
No models added yet
+{t("noModelsYet")}
- Leave empty to use global defaults. These override per-provider settings. -
+{t("advancedHint")}