"use client"; import { useCallback, useState } from "react"; import { Archive, ChevronDown, ChevronUp, X } from "lucide-react"; import { useTranslation } from "react-i18next"; const STORAGE_KEY = "dt:memory:banner-dismissed"; interface MemoryArchivedBannerProps { latestBackup: string | null; variant?: "full" | "compact"; } export default function MemoryArchivedBanner({ latestBackup, variant = "compact", }: MemoryArchivedBannerProps) { const { t } = useTranslation(); const [dismissed, setDismissed] = useState(() => { if (typeof window === "undefined") return null; return window.localStorage.getItem(STORAGE_KEY); }); const [expanded, setExpanded] = useState(false); const dismiss = useCallback(() => { if (!latestBackup) return; if (typeof window !== "undefined") { window.localStorage.setItem(STORAGE_KEY, latestBackup); } setDismissed(latestBackup); }, [latestBackup]); if (!latestBackup || dismissed === latestBackup) return null; if (variant === "full") { return (

{t("Your v1 memory was archived")}

{t( "Stored at memory/backup/{{name}}. v2 starts fresh — interact with DeepTutor and click Update on each doc to build memory.", { name: latestBackup }, )}

); } return (
{expanded && (
{t( "Stored at memory/backup/{{name}}. v2 starts fresh — interact with DeepTutor and click Update on each doc to build memory.", { name: latestBackup }, )}
)}
); }