import { getBrowserTabId, setClientAppState, } from "@agent-native/core/client/hooks"; import { useT } from "@agent-native/core/client/i18n"; import { IconAlertTriangle, IconChevronLeft, IconChevronRight, } from "@tabler/icons-react"; import { useCallback, useEffect, useMemo, useState } from "react"; import { toast } from "sonner"; import { CreateFolderDialog } from "@/components/library/create-folder-dialog"; import { ShareRecordingDialog } from "@/components/player/share-dialog"; import { Button } from "@/components/ui/button"; import { useFolders, useRecordings, useRecordingsCount, useTrashRecording, useArchiveRecording, useRestoreRecording, useMoveRecording, type ListRecordingsArgs, type RecordingSummary, } from "@/hooks/use-library"; import { cn } from "@/lib/utils"; import { BulkActionToolbar, type BulkMoveTarget } from "./bulk-action-toolbar"; import { EmptyState } from "./empty-state"; import { FilterChips, type FilterChip } from "./filter-chips"; import { PageHeader } from "./page-header"; import { RecordingCard } from "./recording-card"; import { SearchBar } from "./search-bar"; import { SortMenu, type SortKey } from "./sort-menu"; interface LibraryGridProps { view: "library" | "shared" | "space" | "archive" | "trash" | "all"; folderId?: string | null; spaceId?: string | null; /** What empty-state illustration to render. Defaults from `view`. */ emptyKind?: "library" | "shared" | "folder" | "space" | "archive" | "trash"; title?: string; tagFilter?: string | null; onClearTag?: () => void; extraActions?: React.ReactNode; } function Skeleton() { return (
{t("libraryGrid.loadFailedBody")}