feat: real API integration + YouTube Data API v3 + progressive loading
- Replace mock useReport() with real Supabase API data pipeline - Add transformReport.ts to map API responses to MarketingReport type - Add useEnrichment() hook for background channel data enrichment - Replace Apify YouTube scraper with YouTube Data API v3 - Add mergeEnrichment() for progressive data loading - Add EmptyState component for graceful empty data handling - Add socialHandles to generate-report metadata - Graceful empty data in ClinicSnapshot, YouTube, Instagram, Facebook - Add Supabase Edge Functions and DB migrations - Add developer handoff documentation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
c6e18b6a67
commit
60cd055042
30 files changed
+2905
-142
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import { motion } from 'motion/react';
|
||||
import { Youtube, Users, Video, Eye, TrendingUp, ExternalLink } from 'lucide-react';
|
||||
import { SectionWrapper } from './ui/SectionWrapper';
|
||||
import { EmptyState } from './ui/EmptyState';
|
||||
import { MetricCard } from './ui/MetricCard';
|
||||
import { DiagnosisRow } from './ui/DiagnosisRow';
|
||||
import type { YouTubeAudit as YouTubeAuditType } from '../../types/report';
|
||||
@@ -16,8 +17,18 @@ function formatNumber(n: number): string {
|
||||
}
|
||||
|
||||
export default function YouTubeAudit({ data }: YouTubeAuditProps) {
|
||||
const hasData = data.subscribers > 0 || data.totalVideos > 0 || data.topVideos.length > 0 || data.diagnosis.length > 0;
|
||||
|
||||
return (
|
||||
<SectionWrapper id="youtube-audit" title="YouTube Analysis" subtitle="유튜브 채널 분석">
|
||||
{!hasData && (
|
||||
<EmptyState
|
||||
message="YouTube 채널 데이터 수집 중"
|
||||
subtext="채널 데이터 보강이 완료되면 구독자, 영상, 조회수 정보가 표시됩니다."
|
||||
/>
|
||||
)}
|
||||
|
||||
{hasData && <>
|
||||
{/* Metrics row */}
|
||||
<div className="grid grid-cols-2 md:grid-cols-4 gap-4 mb-8">
|
||||
<MetricCard
|
||||
@@ -172,6 +183,7 @@ export default function YouTubeAudit({ data }: YouTubeAuditProps) {
|
||||
))}
|
||||
</motion.div>
|
||||
)}
|
||||
</>}
|
||||
</SectionWrapper>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user