"use client"; import { useRef } from "react"; import { useTranslations } from "next-intl"; import { editDuration, hookRange, timecode, trimHook, uid, type EditDocument } from "@/lib/editor/document"; import { prepareTextDraft, type TextDraft } from "@/lib/editor/render"; import { InlineText } from "./inline-text"; /** Hook timing is in output seconds, so its edges stay meaningful across cuts. */ export function HookTrack({ doc, pause, seek, update, onDraft, secondsPerPixel }: { doc: EditDocument; pause: () => void; seek: (time: number) => void; update: (change: (doc: EditDocument) => EditDocument, group?: string) => void; onDraft: (draft: TextDraft | undefined) => void; secondsPerPixel: () => number; }) { const t = useTranslations("editor"); const range = hookRange(doc), total = editDuration(doc); const drag = useRef<{ document: EditDocument; edge: "start" | "end"; x: number; scale: number; group: string } | null>(null); return