"use client"; import { cn } from "@/lib/utils"; // --------------------------------------------------------------------------- // THE WORD STRIP: a span's words as text -- the cut's lit, the one playing // marked, a click seeks there (`onSeek`); the clip editor's, and home's Quick // clip box's (umtool redesign L4). Timed words when the corpus has them (a // words sidecar, a whisper transcript, the captions' word starts), else the // cues. `onWord` (the Quick clip box): a click on a word sets an edge instead. // --------------------------------------------------------------------------- export type StripSource = { words?: { w: string; start: number; end?: number }[] | null; cues?: { start: number; end: number; text: string }[] | null; } | null; export default function WordStrip({ hood, cut, playhead, onSeek, onWord, className, }: { hood: StripSource; cut: { cutStart: number; cutEnd: number }; playhead: number | null; onSeek: (t: number) => void; /** A click on a word, with shift held or not (the Quick clip box: start at it, shift: end after it). */ onWord?: (w: { start: number; end: number | null }, shift: boolean) => void; className?: string; }) { if (!hood) return

reading the words…

; const list = hood.words?.length ? hood.words.map((w) => ({ text: w.w, start: w.start, end: w.end ?? null })) : (hood.cues ?? []).map((c) => ({ text: c.text, start: c.start, end: c.end as number | null })); if (!list.length) return

No words or cues for this span.

; return (

{list.map((w, i) => { const end = w.end ?? list[i + 1]?.start ?? w.start; const mid = (w.start + end) / 2; const inCut = mid >= cut.cutStart && mid <= cut.cutEnd; const now = playhead !== null && playhead >= w.start && playhead < end; return ( {" "} ); })}

); }