mirror of
https://github.com/SrIzan10/hctv.git
synced 2026-06-27 19:02:19 +00:00
fix: viewercount to show actual count
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import { useStreams } from "@/lib/providers/StreamInfoProvider";
|
||||
import { User } from "lucide-react";
|
||||
import { useParams } from "next/navigation";
|
||||
|
||||
export default function ViewerCount() {
|
||||
const streamInfo = useStreams();
|
||||
const { username } = useParams();
|
||||
|
||||
if (streamInfo.isLoading) return null;
|
||||
|
||||
const viewerCount = streamInfo.stream!.reduce((acc, stream) => acc + stream.viewers, 0);
|
||||
const viewerCount = streamInfo.stream!.find(s => s.username === username)?.viewers;
|
||||
|
||||
return (
|
||||
<div className="flex items-center space-x-2 *:text-destructive">
|
||||
|
||||
Reference in New Issue
Block a user