From 913f28e2f27830192a1c80270612d8314eed3353 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Tue, 6 May 2025 00:05:25 -0700 Subject: phase_tracker_only: implement the twitch table --- src/components/SubscriberTable/TwitchTableRow.tsx | 70 +++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 src/components/SubscriberTable/TwitchTableRow.tsx (limited to 'src/components/SubscriberTable/TwitchTableRow.tsx') diff --git a/src/components/SubscriberTable/TwitchTableRow.tsx b/src/components/SubscriberTable/TwitchTableRow.tsx new file mode 100644 index 0000000..b4aae9c --- /dev/null +++ b/src/components/SubscriberTable/TwitchTableRow.tsx @@ -0,0 +1,70 @@ +"use client"; +import Image from "next/image"; +import type React from "react"; +import type { TwitchChannelDataProp } from "./TwitchDataTable"; + +interface TwitchRowProps { + channel: TwitchChannelDataProp; + index: number; +} + +const TwitchTableRow: React.FC = ({ channel, index }) => ( + (window.location.href = "/stats/" + channel.channel_name)} + > + {index + 1} + + {channel.channel_name} + {channel.channel_name} + { + (() => { + const words = channel.channel_name.split(' '); + if (words.length >= 2) { + return `${words[0][0]}.${words[1][0]}`; + } else if (words.length === 1) { + return `${words[0][0]}.`; + } + return ''; + })() + } + + + {channel.sub_org} + + + {Number(channel.subscribers).toLocaleString()} + + + {Number(channel.twitch_followers).toLocaleString()} + + + {Number(channel.total_sum).toLocaleString()} + + + {channel.max_following !== undefined && ( + channel.subscribers + ? "text-purple-500" // Twitch color + : channel.subscribers > channel.twitch_followers + ? "text-red-600" // YouTube color + : "" + } + > + {channel.max_following.toLocaleString() || "0"} + + )} + + + +); + +export default TwitchTableRow; -- cgit v1.2.3