"use client"; import { useTranslation } from "react-i18next"; import { kbProvider, type KnowledgeBase } from "@/lib/knowledge-helpers"; export default function LightRagEmbeddingWarning({ kb, }: { kb: KnowledgeBase; }) { const { t } = useTranslation(); if (kbProvider(kb) !== "lightrag" || !kb.metadata?.embedding_mismatch) return null; const meta = kb.metadata; return ( {t( "The current embedding configuration does not match this index. Restore the original configuration or rebuild with the current embedding before querying or adding documents.", )} {t("Index embedding")}: {meta.indexed_embedding_model || t("Unknown")} ·{" "} {meta.indexed_embedding_dim ?? "?"} {t("d")} {t("Current embedding")}: {meta.current_embedding_model || t("Unknown")}{" "} · {meta.current_embedding_dim ?? "?"} {t("d")} ); }