aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/SubscriberTable/SubscriberTableRow.tsx
blob: 8708f8af43755e5748fcbd2f8e742f7f37e1a263 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"use client";
import Image from "next/image";
import type React from "react";
import type { ChannelDataProp } from "./SubscriberTable";

interface ChannelRowProps {
	channel: ChannelDataProp;
	index: number;
}

const ChannelRow: React.FC<ChannelRowProps> = ({ channel, index }) => (
	<tr
		key={index}
		className="border-b hover:bg-gray-100 cursor-pointer"
		onClick={() => (window.location.href = "/stats/" + channel.channel_name)}
	>
	<td className="py-3 px-1 sm:px-3 hidden sm:table-cell">{index + 1}</td>
	<td className="py-3 px-1 sm:px-3 flex items-center">
		<Image
			src={channel.profile_pic}
			alt={channel.channel_name}
			width={50}
			height={50}
			className="rounded-full"
		/>
		<span className="ml-2">{channel.channel_name}</span>
	</td>
		<td className="py-3 px-1 sm:px-3 hidden sm:table-cell">
			{channel.sub_org}
		</td>
		<td className="py-3 px-1 sm:px-3 hidden sm:table-cell">
			{channel.video_count}
		</td>
		<td className="py-3 px-1 sm:px-3 hidden sm:table-cell">
			{Number(channel.views).toLocaleString()}
		</td>
		<td className="py-3 px-1 sm:px-3">
			{Number(channel.subscribers).toLocaleString()}
		</td>
		<td className="py-3 px-1 sm:px-3">
			{channel.day_diff > 0
				? `+${Number(channel.day_diff).toLocaleString()}`
				: Number(channel.day_diff).toLocaleString()}
		</td>
	</tr>
);

export default ChannelRow;
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage