"use client";
import {
AlertTriangle,
ChevronDown,
ChevronRight,
FolderTree,
Loader2,
RefreshCw,
Search,
X,
} from "lucide-react";
import { useTranslations } from "next-intl";
import { memo, useMemo, useState, useTransition } from "react";
import {
refreshCatalogTree,
useLiveCatalog,
} from "@/features/catalog/client/use-live-catalog";
import { cn } from "@/lib/utils";
import type { TreeNode } from "@/types/catalog";
/**
* A refresh that fails must be visible. Every number and category below is
* presented as current, so silently keeping the previous tree after a failed
* read would show pre-import data as if nothing had happened — and a staff
* member has no other signal that the import they just ran is not on screen.
*/
function LiveCatalogNotice() {
const t = useTranslations("admin.studio");
const { refreshError, refreshing } = useLiveCatalog();
const [retrying, startRetry] = useTransition();
if (!refreshError && !refreshing) return null;
return (