[feat] report 페이지 추가

This commit is contained in:
minheon committed 2026-04-01 10:52:50 +09:00
1 parent af58b96aff
commit 675cfcab8d
126 files changed
+3642 -1

No files matched your search

@@ -0,0 +1,47 @@
import ChannelYoutubeIcon from "@/assets/icons/channel-youtube.svg?react";
import ExternalLinkIcon from "@/assets/icons/external-link.svg?react";
import type { YouTubeAudit } from "@/features/report/types/youtubeAudit";
import { safeUrl } from "@/lib/safeUrl";
export type YouTubeChannelInfoCardProps = {
data: YouTubeAudit;
};
export function YouTubeChannelInfoCard({ data }: YouTubeChannelInfoCardProps) {
return (
<div className="rounded-2xl bg-white border border-neutral-20 shadow-sm p-6 mb-8 animate-fade-in-up animation-delay-100">
<div className="flex items-center gap-3 mb-4">
<div className="w-10 h-10 rounded-xl bg-[var(--color-status-critical-bg)] flex items-center justify-center text-[var(--color-status-critical-text)] [&_svg]:block">
<ChannelYoutubeIcon width={20} height={20} aria-hidden />
</div>
<div className="min-w-0">
<p className="title-18 text-navy-900 break-keep">{data.channelName}</p>
<p className="body-14 text-neutral-60 break-keep">{data.handle}</p>
</div>
</div>
<p className="body-14 text-neutral-70 mb-4 whitespace-pre-line break-keep">{data.channelDescription}</p>
<div className="flex flex-wrap gap-3 body-14 text-neutral-60">
<span className="break-keep">개설일: {data.channelCreatedDate}</span>
<span className="break-keep">평균 영상 길이: {data.avgVideoLength}</span>
<span className="break-keep">업로드 빈도: {data.uploadFrequency}</span>
</div>
{data.linkedUrls.length > 0 ? (
<div className="mt-4 flex flex-wrap gap-2">
{data.linkedUrls.map((link) => (
<a
key={link.url}
href={safeUrl(link.url)}
target="_blank"
rel="noopener noreferrer"
className="inline-flex items-center gap-1 label-12 text-violet-700 hover:underline break-keep cursor-pointer"
>
<ExternalLinkIcon aria-hidden />
{link.label}
</a>
))}
</div>
) : null}
</div>
);
}
@@ -0,0 +1,44 @@
import EyeIcon from "@/assets/icons/eye.svg?react";
import TrendingUpIcon from "@/assets/icons/trending-up.svg?react";
import VideoIcon from "@/assets/icons/video.svg?react";
import UsersIcon from "@/assets/icons/users.svg?react";
import { MetricCard } from "@/components/card/MetricCard";
import type { YouTubeAudit } from "@/features/report/types/youtubeAudit";
import { formatCompactNumber } from "@/lib/formatNumber";
export type YouTubeMetricsGridProps = {
data: YouTubeAudit;
};
export function YouTubeMetricsGrid({ data }: YouTubeMetricsGridProps) {
const growth = data.weeklyViewGrowth;
const trend = growth.percentage > 0 ? "up" : growth.percentage < 0 ? "down" : "neutral";
return (
<div className="grid grid-cols-2 md:grid-cols-4 gap-4 mb-8">
<MetricCard
label="구독자"
value={formatCompactNumber(data.subscribers)}
icon={<UsersIcon width={20} height={20} aria-hidden />}
subtext={data.subscriberRank}
/>
<MetricCard
label="총 영상 수"
value={formatCompactNumber(data.totalVideos)}
icon={<VideoIcon width={20} height={20} aria-hidden />}
/>
<MetricCard
label="총 조회수"
value={formatCompactNumber(data.totalViews)}
icon={<EyeIcon width={20} height={20} aria-hidden />}
/>
<MetricCard
label="주간 성장"
value={`+${formatCompactNumber(growth.absolute)}`}
icon={<TrendingUpIcon width={20} height={20} aria-hidden />}
subtext={`${growth.percentage > 0 ? "+" : ""}${growth.percentage}%`}
trend={trend}
/>
</div>
);
}
@@ -0,0 +1,34 @@
import { TopVideoCard } from "@/components/card/TopVideoCard";
import type { TopVideo } from "@/features/report/types/youtubeAudit";
export type YouTubeTopVideosBlockProps = {
videos: TopVideo[];
};
export function YouTubeTopVideosBlock({ videos }: YouTubeTopVideosBlockProps) {
if (videos.length === 0) return null;
return (
<div className="mb-8 animate-fade-in-up animation-delay-200">
<p className="body-14-medium text-neutral-80 mb-4 break-keep">
인기 영상 TOP {videos.length}
</p>
<div
className="flex gap-4 overflow-x-auto pb-4 scrollbar-hide"
style={{ scrollbarWidth: "none", msOverflowStyle: "none" }}
>
{videos.map((video, i) => (
<TopVideoCard
key={`${video.title}-${i}`}
title={video.title}
views={video.views}
uploadedAgo={video.uploadedAgo}
type={video.type}
duration={video.duration}
style={{ animationDelay: `${i * 50}ms` }}
/>
))}
</div>
</div>
);
}