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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { Badge } from "@/components/ui/badge";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
interface ChannelCardProps {
channel_id: string;
name: string;
avatarUrl: string;
subscriberCount: number;
videoCount: number;
viewCount: number;
suborg: string;
nextMilestone: string;
nextMilestoneDays: string;
nextMilestoneDate: string;
}
export function ChannelCard(props: ChannelCardProps) {
const {
channel_id,
name,
avatarUrl,
subscriberCount,
videoCount,
viewCount,
suborg,
nextMilestone,
nextMilestoneDays,
nextMilestoneDate,
} = props;
return (
<Card className="w-[500px] shadow-lg rounded-lg overflow-hidden mt-4 py-4">
<CardHeader>
<div className="flex items-center space-x-4 p-4">
<Avatar>
<AvatarImage src={avatarUrl} />
<AvatarFallback>PR</AvatarFallback>
</Avatar>
<div>
<a
className="hover:underline"
href={`https://youtube.com/channel/${channel_id}`}
>
<CardTitle>{name}</CardTitle>
</a>
<Badge variant="secondary">{suborg}</Badge>
</div>
</div>
</CardHeader>
<CardContent className="px-4 py-2 space-y-4">
<div className="flex flex-col items-center">
<span className="text-l text-gray-600">Subscribers</span>
<span className="font-semibold">
{Number(subscriberCount).toLocaleString()}
</span>
</div>
<div className="flex flex-col items-center">
<span className="text-l text-gray-600">Videos</span>
<span className="font-semibold">{videoCount}</span>
</div>
<div className="flex flex-col items-center">
<span className="text-l text-gray-600">View Count</span>
<span className="font-semibold">
{Number(viewCount).toLocaleString()}
</span>
</div>
<div className="flex flex-col items-center">
<span className="text-l text-gray-600">Next Milestone</span>
<span className="font-semibold">
{Number(nextMilestone).toLocaleString()}
</span>
<div className="flex justify-center items-center">
<span className="text-sm text-gray-600 px-2">
{nextMilestoneDays} days
</span>
<span className="text-sm text-gray-600 px-2">
{nextMilestoneDate}
</span>
</div>
</div>
</CardContent>
</Card>
);
}
|