From e24a6b8c0bd5f8b9705c3bd1d2b0eb1ddd96c775 Mon Sep 17 00:00:00 2001 From: Leo dev Date: Sat, 7 Feb 2026 21:36:01 +0100 Subject: [PATCH] Views in live run page --- src/app/run/components/RunTimer.tsx | 17 +++++++++++++---- src/app/run/page.tsx | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/app/run/components/RunTimer.tsx b/src/app/run/components/RunTimer.tsx index 4f0748d..da520b8 100644 --- a/src/app/run/components/RunTimer.tsx +++ b/src/app/run/components/RunTimer.tsx @@ -1,28 +1,37 @@ import { Card, CardContent } from "@/components/ui/card"; import formatTime from "@/lib/time-format"; import { LiveRun } from "@/modules/live-run/types"; +import { Eye } from "lucide-react"; import { useEffect, useState } from "react"; -export default function RunTimer({ runInfo }: { runInfo: LiveRun }) { +export default function RunTimer({ run }: { run: LiveRun }) { const [time, setTime] = useState("00:00:00"); useEffect(() => { // Update function calculates elapsed time - const updateTime = () => setTime(formatTime(Date.now() - runInfo.start)); + const updateTime = () => setTime(formatTime(Date.now() - run.start)); // Update immediately and then every second updateTime(); const interval = setInterval(updateTime, 50); return () => clearInterval(interval); // cleanup on unmount - }, [runInfo.start]); + }, [run.start]); return (

{time}

-

{runInfo.category}

+ +

+ {run.category} +

+

+ + {run.views} +

+
); diff --git a/src/app/run/page.tsx b/src/app/run/page.tsx index 32312af..e56ed70 100644 --- a/src/app/run/page.tsx +++ b/src/app/run/page.tsx @@ -40,7 +40,7 @@ export default function Run() {
- {runInfo && } + {runInfo && }