From c355b3ae26035b4951d8c7b2ce786951161ca229 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 23 Apr 2026 11:05:14 -0500 Subject: [PATCH] Unify clip row playback --- frontend/src/api/client.ts | 2 +- frontend/src/components/ClipSummaryRow.tsx | 44 +++ frontend/src/hooks/useClipPlayback.ts | 192 ++++++++++++ frontend/src/pages/GamedayPage.tsx | 170 ++--------- frontend/src/pages/LibraryPage.tsx | 326 ++++++++------------- frontend/src/styles.css | 15 + 6 files changed, 390 insertions(+), 359 deletions(-) create mode 100644 frontend/src/components/ClipSummaryRow.tsx create mode 100644 frontend/src/hooks/useClipPlayback.ts diff --git a/frontend/src/api/client.ts b/frontend/src/api/client.ts index 1784d12..0427bdf 100644 --- a/frontend/src/api/client.ts +++ b/frontend/src/api/client.ts @@ -10,7 +10,7 @@ import type { TeamSnapTokenResponse, } from "./types"; -const API_BASE = import.meta.env.VITE_API_BASE_URL ?? "http://localhost:8000"; +export const API_BASE = import.meta.env.VITE_API_BASE_URL ?? "http://localhost:8000"; type UploadAssetPayload = { teamId: string; diff --git a/frontend/src/components/ClipSummaryRow.tsx b/frontend/src/components/ClipSummaryRow.tsx new file mode 100644 index 0000000..b00e2d5 --- /dev/null +++ b/frontend/src/components/ClipSummaryRow.tsx @@ -0,0 +1,44 @@ +import type { ReactNode } from "react"; + +import type { AudioClip } from "../api/types"; + +export function ClipSummaryRow({ + clip, + isPlaying, + onTogglePlayback, + titleExtras, + subtitle, + actions, + isPlaybackAvailable = true, +}: { + clip: AudioClip; + isPlaying: boolean; + onTogglePlayback: () => void; + titleExtras?: ReactNode; + subtitle?: ReactNode; + actions?: ReactNode; + isPlaybackAvailable?: boolean; +}) { + return ( +
+
+