"use client"; import Link from "next/link"; import { useRouter } from "next/navigation"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { PostBody, type PostCaptureView } from "yt-dlp-transcript-common/components/PostBody"; import type { Post } from "yt-dlp-transcript-common/lib/posts"; import { Badge } from "@/components/ui/badge"; import { Button, buttonVariants } from "@/components/ui/button"; import { useHydrated } from "@/components/ui/use-hydrated"; import { captureSentence, filterWords, goneSentence, goneTabSentence, libraryHref } from "@/lib/library/filters.mjs"; import { isTyping, LIBRARY_KEYS, libraryAction, stateOfAction } from "@/lib/library/keys.mjs"; import { libraryMediaSrc } from "@/lib/library/mediaSrc.mjs"; import { pressSetOf, UNDO_SAYS, undoSetOf } from "@/lib/library/undo.mjs"; import type { LibraryData, LibraryPost, LibraryTopic, LibraryView as View } from "@/lib/library/load"; import { cn } from "@/lib/utils"; import { AccountsPanel, MoveControl, send, TopicOrganise } from "./OrganisePanel"; // THE POSTS LIBRARY (app/tools/library/page.tsx): topics on the left, the // posts of the view with their captured media in the body, and the presses. // // EVERY PRESS IS A POST TO /api/library/*, which is the editor's action // written as the operator's. Nothing here writes a library's file, asks X // anything, or offers a post to a project, a report or a site. // // NO LINK HERE PREFETCHES: every address of this page is a read through the // editor, and a prefetch is that read made for a view nobody opened. // // THE WORDS: a post a trending page no longer shows is "Gone from the page at //