import type { ReactNode } from "react"; import { Play } from "lucide-react"; import type { TFunction } from "i18next"; import type { Video } from "../lib/api"; import { formatDuration } from "../lib/format"; import type { Column } from "../lib/tableColumns"; import { Pressable } from "./ui/Pressable"; // Column definitions for the playlist detail table, in their own file like `channelColumns.tsx`. // // The `grip` column carries no renderer: the drag handle needs the `useSortable` attributes that // only exist inside the row component, which a `render(row)` closure can't reach. It stays in the // list anyway so ONE column array drives both the header and the body — the row renderer fills // that cell itself. Everything else is an ordinary cell. export const GRIP_KEY = "grip"; export function playlistColumns({ t, indexOf, onPlay, more, }: { t: TFunction; /** Position in the STORED order (1-based on screen) — not the row's position in the current view, * so a view-sort never renumbers the playlist under the reader. */ indexOf: (v: Video) => number; onPlay: (v: Video) => void; /** The row's "…" — the visible door to its menu, where "Remove" now lives. */ more: (v: Video) => ReactNode; }): Column