From 7c3f1298095727fcacdc903fa79369d5624bf3df Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Wed, 26 Jun 2024 22:01:38 -0700 Subject: lint project --- src/components/SubscriberTable/SubscriberTable.tsx | 123 ++++++++++++--------- .../SubscriberTable/SubscriberTableRow.tsx | 70 +++++++----- 2 files changed, 110 insertions(+), 83 deletions(-) (limited to 'src/components/SubscriberTable') diff --git a/src/components/SubscriberTable/SubscriberTable.tsx b/src/components/SubscriberTable/SubscriberTable.tsx index b07c75d..05080ca 100644 --- a/src/components/SubscriberTable/SubscriberTable.tsx +++ b/src/components/SubscriberTable/SubscriberTable.tsx @@ -2,67 +2,82 @@ import React from "react"; import ChannelRow from "./SubscriberTableRow"; interface ChannelDataProp { - channel_name: string; - profile_pic: string; - subscribers: number; - sub_org: string; - video_count: number; - day_diff: number; - views: number; + channel_name: string; + profile_pic: string; + subscribers: number; + sub_org: string; + video_count: number; + day_diff: number; + views: number; } interface SubscriberDataTableProp { - channel_data: ChannelDataProp[]; - timestamp: string; + channel_data: ChannelDataProp[]; + timestamp: string; } const DataTable = ({ channel_data, timestamp }: SubscriberDataTableProp) => { - if (!channel_data) { - return null; - } + if (!channel_data) { + return null; + } -return ( - <> -
-

Subscriber Count

-

Last Updated: {timestamp}

-
-
- - - - - - - - - - - - - - {channel_data.map((channel, index) => ( - - ))} - -
- RANK - - CHANNEL - - GROUP - - VIDEO COUNT - - VIEW COUNT - - SUBSCRIBERS - - DIFF (24H) -
-
- -); + return ( + <> +
+

Subscriber Count

+

Last Updated: {timestamp}

+
+
+ + + + + + + + + + + + + + {channel_data.map((channel, index) => ( + + ))} + +
+ RANK + + CHANNEL + + GROUP + + VIDEO COUNT + + VIEW COUNT + + SUBSCRIBERS + + DIFF (24H) +
+
+ + ); }; export default DataTable; diff --git a/src/components/SubscriberTable/SubscriberTableRow.tsx b/src/components/SubscriberTable/SubscriberTableRow.tsx index 040c693..595a2c1 100644 --- a/src/components/SubscriberTable/SubscriberTableRow.tsx +++ b/src/components/SubscriberTable/SubscriberTableRow.tsx @@ -1,36 +1,48 @@ -"use client" -import React from 'react'; -import Image from 'next/image'; -import { ChannelDataProp } from './SubscriberTable'; +"use client"; +import Image from "next/image"; +import type React from "react"; +import type { ChannelDataProp } from "./SubscriberTable"; interface ChannelRowProps { - channel: ChannelDataProp; - index: number; + channel: ChannelDataProp; + index: number; } const ChannelRow: React.FC = ({ channel, index }) => ( - window.location.href = "/stats/"+channel.channel_name}> - {index + 1} - - {channel.channel_name} - - {channel.channel_name} - - - {channel.sub_org} - {channel.video_count} - {Number(channel.views).toLocaleString()} - {Number(channel.subscribers).toLocaleString()} - - {channel.day_diff > 0 ? `+${Number(channel.day_diff).toLocaleString()}` : Number(channel.day_diff).toLocaleString()} - - + (window.location.href = "/stats/" + channel.channel_name)} + > + {index + 1} + + {channel.channel_name} + {channel.channel_name} + + + {channel.sub_org} + + + {channel.video_count} + + + {Number(channel.views).toLocaleString()} + + + {Number(channel.subscribers).toLocaleString()} + + + {channel.day_diff > 0 + ? `+${Number(channel.day_diff).toLocaleString()}` + : Number(channel.day_diff).toLocaleString()} + + ); -export default ChannelRow; \ No newline at end of file +export default ChannelRow; -- cgit v1.2.3