diff --git a/frontend/src/pages/StreamControl.tsx b/frontend/src/pages/StreamControl.tsx index 86b8c05..b3ff5d0 100644 --- a/frontend/src/pages/StreamControl.tsx +++ b/frontend/src/pages/StreamControl.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from "react"; -import { Radio, Check, Bookmark, Scissors, Film, Activity, Loader2, X } from "lucide-react"; +import { Radio, Check, Bookmark, Scissors, Film, Activity, Loader2, Plus, X } from "lucide-react"; import clsx from "clsx"; import Box from "../components/Box.tsx"; import PrimaryButton from "../components/buttons/PrimaryButton.tsx"; @@ -9,7 +9,7 @@ import { getMarkers, createMarker, deleteMarker } from "../utils/api/markers.ts" import { saveSectionByMarkers, clipSection } from "../utils/api/media.ts"; import { getJob } from "../utils/api/jobs.ts"; import type { StreamStatus, StreamHistoryItem, Marker, JobResponse } from "../utils/types.ts"; -import { formatTime, formatLocalDate, stringToDate } from "../utils/utils.ts"; +import { formatLocalDate, formatLocalTime, stringToDate } from "../utils/utils.ts"; const inputClass = "border border-hairline bg-fields rounded-md w-full p-2 text-sm focus:outline-none focus:ring-2 focus:ring-muted transition-colors"; const labelClass = "font-data text-[11px] text-muted uppercase tracking-[0.12em]"; @@ -59,11 +59,73 @@ const JobStatus = ({ job }: { job: TrackedJob }) => { ); }; +type RailSegment = "none" | "plain" | "lit"; + +type MarkerRowProps = { + marker: Marker; + role: "start" | "end" | "between" | null; + /** Rail segments above and below the dot — "lit" inside the chosen section. */ + railAbove: RailSegment; + railBelow: RailSegment; + onSelect: () => void; + onDelete: () => void; +}; + +const railClass = (segment: RailSegment) => clsx( + "w-px", + segment === "lit" && "bg-terracotta", + segment === "plain" && "bg-inactive-strong/60", + segment === "none" && "bg-transparent" +); + +const MarkerRow = ({ marker, role, railAbove, railBelow, onSelect, onDelete }: MarkerRowProps) => ( +
{elapsed}
-elapsed
-{markerError}
} - {markers.length > 0 && ( -{markerError}
} ++ Nothing marked yet. Markers stack up here, newest first — pick two to save the section between them. +
+ ) : ( +Add at least two markers above to save a section between them.
+Add at least two markers to save a section between them.
) : ( <>Clip and save actions will show up here.
- ) : ( -Clip and save actions will show up here.
+ ) : ( +