diff --git a/frontend/src/components/Stream/VodsDashboard.tsx b/frontend/src/components/Stream/VodsDashboard.tsx index b52a8ef..ab39a1b 100644 --- a/frontend/src/components/Stream/VodsDashboard.tsx +++ b/frontend/src/components/Stream/VodsDashboard.tsx @@ -1,37 +1,48 @@ import React from "react"; import ListRow from "../Layout/ListRow"; import { VodType } from "../../types/VodType"; +import { useNavigate } from "react-router-dom"; interface VodsDashboardProps { - vods: VodType[]; + vods: VodType[]; } const VodsDashboard: React.FC = ({ vods }) => { - const handleVodClick = (vodUrl: string) => { - window.open(vodUrl, "_blank"); - }; + const navigate = useNavigate(); - return ( -
-

Past Broadcasts

+ const handleVodClick = (vodId: string) => { + if (vods.length > 0) { + navigate(`/stream/${vods[0].username}/vods/${vodId}`); + } + }; - {vods.length === 0 ? ( -
-

No past broadcasts found

-
- ) : ( - - )} -
- ); + // Ensure each VOD has a hardcoded thumbnail path + const thumbnails = vods.map((vod) => ({ + ...vod, + thumbnail: `/vods/${vod.username}/${vod.vod_id}.png`, + })); + + return ( +
+

Past Broadcasts

+ + {vods.length === 0 ? ( +
+

No past broadcasts found

+
+ ) : ( + + )} +
+ ); }; export default VodsDashboard; diff --git a/frontend/src/pages/Vods.tsx b/frontend/src/pages/Vods.tsx index 5387a4f..934fbc2 100644 --- a/frontend/src/pages/Vods.tsx +++ b/frontend/src/pages/Vods.tsx @@ -50,7 +50,7 @@ const Vods: React.FC = () => {

{username}'s VODs