feat: INFINITH Marketing Platform — Phase 1 MVP
Complete frontend reference implementation: - Landing page (7 sections, responsive, animated) - Marketing Intelligence Report (11 sections, VIEW Plastic Surgery demo) - Marketing Execution Plan (8 sections, branding/channel/calendar) - Content Studio wizard (channel → strategy → sound → generate) - Channel Connect page (7 platform OAuth flows) - Distribution page (YouTube publish flow) - Performance Dashboard (KPI, funnel, heatmap, trends) - PDF export (section-based, no mid-content splits) - Design system (pastel palette, filled icons, Pretendard/Playfair) - Page navigator (landing ↔ report ↔ plan) - Asset upload (drag & drop, image/video/text) Docs: PRD v2.0, DESIGN_SYSTEM.md, API_CONNECTORS.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
bbb7a0de60
90 files changed
+16754
No files matched your search
@@ -0,0 +1,132 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useNavigate, useLocation } from 'react-router';
|
||||
import { motion } from 'motion/react';
|
||||
import { Check } from 'lucide-react';
|
||||
|
||||
const steps = [
|
||||
'Scanning website...',
|
||||
'Capturing channel screenshots...',
|
||||
'Analyzing social media presence...',
|
||||
'Evaluating brand consistency...',
|
||||
'Generating intelligence report...',
|
||||
];
|
||||
|
||||
export default function AnalysisLoadingPage() {
|
||||
const [currentStep, setCurrentStep] = useState(0);
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
const url = (location.state as { url?: string })?.url;
|
||||
|
||||
useEffect(() => {
|
||||
const timers: ReturnType<typeof setTimeout>[] = [];
|
||||
|
||||
steps.forEach((_, index) => {
|
||||
timers.push(
|
||||
setTimeout(() => {
|
||||
setCurrentStep(index + 1);
|
||||
}, (index + 1) * 1250)
|
||||
);
|
||||
});
|
||||
|
||||
timers.push(
|
||||
setTimeout(() => {
|
||||
navigate('/report/view-clinic', { replace: true });
|
||||
}, 5500)
|
||||
);
|
||||
|
||||
return () => timers.forEach(clearTimeout);
|
||||
}, [navigate]);
|
||||
|
||||
return (
|
||||
<div className="relative min-h-screen bg-primary-900 flex flex-col items-center justify-center px-6 overflow-hidden">
|
||||
{/* Radial gradient overlay */}
|
||||
<div className="absolute inset-0 bg-[radial-gradient(ellipse_at_center,_rgba(79,29,161,0.25)_0%,_transparent_70%)]" />
|
||||
|
||||
{/* Purple glow blob */}
|
||||
<div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[500px] h-[500px] bg-purple-600/20 rounded-full blur-[120px] pointer-events-none" />
|
||||
|
||||
<div className="relative z-10 flex flex-col items-center w-full max-w-lg">
|
||||
{/* INFINITH logo text */}
|
||||
<motion.h1
|
||||
initial={{ opacity: 0, y: 20 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ duration: 0.6 }}
|
||||
className="text-4xl md:text-5xl font-serif font-bold text-gradient mb-4"
|
||||
>
|
||||
INFINITH
|
||||
</motion.h1>
|
||||
|
||||
{/* Entered URL */}
|
||||
{url && (
|
||||
<motion.p
|
||||
initial={{ opacity: 0, y: 20 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ duration: 0.6, delay: 0.1 }}
|
||||
className="text-purple-300/80 text-sm font-mono mb-12 truncate max-w-full"
|
||||
>
|
||||
{url}
|
||||
</motion.p>
|
||||
)}
|
||||
|
||||
{/* Analysis steps */}
|
||||
<div className="w-full space-y-5 mb-14">
|
||||
{steps.map((step, index) => {
|
||||
const isCompleted = currentStep > index;
|
||||
const isActive = currentStep === index;
|
||||
|
||||
return (
|
||||
<motion.div
|
||||
key={step}
|
||||
initial={{ opacity: 0, x: -20 }}
|
||||
animate={{ opacity: isActive || isCompleted ? 1 : 0.3, x: 0 }}
|
||||
transition={{ duration: 0.4, delay: index * 0.15 }}
|
||||
className="flex items-center gap-4"
|
||||
>
|
||||
{/* Status icon */}
|
||||
<div className="w-7 h-7 flex-shrink-0 flex items-center justify-center">
|
||||
{isCompleted ? (
|
||||
<motion.div
|
||||
initial={{ scale: 0 }}
|
||||
animate={{ scale: 1 }}
|
||||
transition={{ type: 'spring', stiffness: 300, damping: 20 }}
|
||||
className="w-7 h-7 rounded-full bg-gradient-to-r from-[#4F1DA1] to-[#6C5CE7] flex items-center justify-center"
|
||||
>
|
||||
<Check className="w-4 h-4 text-white" strokeWidth={3} />
|
||||
</motion.div>
|
||||
) : isActive ? (
|
||||
<div className="w-7 h-7 rounded-full border-2 border-purple-400 border-t-transparent animate-spin" />
|
||||
) : (
|
||||
<div className="w-7 h-7 rounded-full border-2 border-white/10" />
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Step text */}
|
||||
<span
|
||||
className={`text-base font-sans transition-colors duration-300 ${
|
||||
isCompleted
|
||||
? 'text-white'
|
||||
: isActive
|
||||
? 'text-purple-200'
|
||||
: 'text-white/30'
|
||||
}`}
|
||||
>
|
||||
{step}
|
||||
</span>
|
||||
</motion.div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* Progress bar */}
|
||||
<div className="w-full h-2 bg-white/10 rounded-full overflow-hidden">
|
||||
<motion.div
|
||||
initial={{ width: '0%' }}
|
||||
animate={{ width: '100%' }}
|
||||
transition={{ duration: 5, ease: 'linear' }}
|
||||
className="h-full bg-gradient-to-r from-[#4F1DA1] to-[#6C5CE7] rounded-full"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,371 @@
|
||||
import { useState, useCallback } from 'react';
|
||||
import { useNavigate } from 'react-router';
|
||||
import { motion, AnimatePresence } from 'motion/react';
|
||||
import {
|
||||
YoutubeFilled,
|
||||
InstagramFilled,
|
||||
FacebookFilled,
|
||||
GlobeFilled,
|
||||
TiktokFilled,
|
||||
} from '../components/icons/FilledIcons';
|
||||
import type { ComponentType } from 'react';
|
||||
|
||||
interface ChannelDef {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
icon: ComponentType<{ size?: number; className?: string }>;
|
||||
brandColor: string;
|
||||
bgColor: string;
|
||||
borderColor: string;
|
||||
fields: { key: string; label: string; placeholder: string; type?: string }[];
|
||||
}
|
||||
|
||||
const CHANNELS: ChannelDef[] = [
|
||||
{
|
||||
id: 'youtube',
|
||||
name: 'YouTube',
|
||||
description: '채널 연동으로 영상 자동 업로드, 성과 분석',
|
||||
icon: YoutubeFilled,
|
||||
brandColor: '#FF0000',
|
||||
bgColor: '#FFF0F0',
|
||||
borderColor: '#F5D5DC',
|
||||
fields: [
|
||||
{ key: 'channelUrl', label: '채널 URL', placeholder: 'https://youtube.com/@YourChannel' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'instagram_kr',
|
||||
name: 'Instagram KR',
|
||||
description: '한국 계정 — Reels, Feed, Stories 자동 게시',
|
||||
icon: InstagramFilled,
|
||||
brandColor: '#E1306C',
|
||||
bgColor: '#FFF0F5',
|
||||
borderColor: '#F5D0DC',
|
||||
fields: [
|
||||
{ key: 'handle', label: '핸들', placeholder: '@viewclinic_kr' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'instagram_en',
|
||||
name: 'Instagram EN',
|
||||
description: '글로벌 계정 — 해외 환자 대상 콘텐츠',
|
||||
icon: InstagramFilled,
|
||||
brandColor: '#E1306C',
|
||||
bgColor: '#FFF0F5',
|
||||
borderColor: '#F5D0DC',
|
||||
fields: [
|
||||
{ key: 'handle', label: '핸들', placeholder: '@viewplasticsurgery' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'facebook_kr',
|
||||
name: 'Facebook KR',
|
||||
description: '한국 페이지 — 광고 리타겟, 콘텐츠 배포',
|
||||
icon: FacebookFilled,
|
||||
brandColor: '#1877F2',
|
||||
bgColor: '#F0F4FF',
|
||||
borderColor: '#C5D5F5',
|
||||
fields: [
|
||||
{ key: 'pageUrl', label: '페이지 URL', placeholder: 'https://facebook.com/YourPage' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'facebook_en',
|
||||
name: 'Facebook EN',
|
||||
description: '글로벌 페이지 — 해외 환자 유입',
|
||||
icon: FacebookFilled,
|
||||
brandColor: '#1877F2',
|
||||
bgColor: '#F0F4FF',
|
||||
borderColor: '#C5D5F5',
|
||||
fields: [
|
||||
{ key: 'pageUrl', label: '페이지 URL', placeholder: 'https://facebook.com/YourPageEN' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'naver_blog',
|
||||
name: 'Naver Blog',
|
||||
description: 'SEO 블로그 포스트 자동 게시, 키워드 최적화',
|
||||
icon: GlobeFilled,
|
||||
brandColor: '#03C75A',
|
||||
bgColor: '#F0FFF5',
|
||||
borderColor: '#C5F5D5',
|
||||
fields: [
|
||||
{ key: 'blogUrl', label: '블로그 URL', placeholder: 'https://blog.naver.com/yourblog' },
|
||||
{ key: 'apiKey', label: 'API Key', placeholder: 'Naver Open API Key', type: 'password' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'naver_place',
|
||||
name: 'Naver Place',
|
||||
description: '플레이스 정보 동기화, 리뷰 모니터링',
|
||||
icon: GlobeFilled,
|
||||
brandColor: '#03C75A',
|
||||
bgColor: '#F0FFF5',
|
||||
borderColor: '#C5F5D5',
|
||||
fields: [
|
||||
{ key: 'placeUrl', label: '플레이스 URL', placeholder: 'https://map.naver.com/...' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'tiktok',
|
||||
name: 'TikTok',
|
||||
description: 'Shorts 크로스포스팅, 트렌드 콘텐츠',
|
||||
icon: TiktokFilled,
|
||||
brandColor: '#000000',
|
||||
bgColor: '#F5F5F5',
|
||||
borderColor: '#E0E0E0',
|
||||
fields: [
|
||||
{ key: 'handle', label: '핸들', placeholder: '@yourclinic' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'gangnamunni',
|
||||
name: '강남언니',
|
||||
description: '리뷰 모니터링, 평점 추적, 시술 정보 동기화',
|
||||
icon: GlobeFilled,
|
||||
brandColor: '#6B2D8B',
|
||||
bgColor: '#F3F0FF',
|
||||
borderColor: '#D5CDF5',
|
||||
fields: [
|
||||
{ key: 'hospitalUrl', label: '병원 페이지 URL', placeholder: 'https://gangnamunni.com/hospitals/...' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'website',
|
||||
name: 'Website',
|
||||
description: '홈페이지 SEO 모니터링, 트래킹 픽셀 관리',
|
||||
icon: GlobeFilled,
|
||||
brandColor: '#6C5CE7',
|
||||
bgColor: '#F3F0FF',
|
||||
borderColor: '#D5CDF5',
|
||||
fields: [
|
||||
{ key: 'url', label: '웹사이트 URL', placeholder: 'https://www.yourclinic.com' },
|
||||
{ key: 'gaId', label: 'Google Analytics ID', placeholder: 'G-XXXXXXXXXX' },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
type ConnectionStatus = 'disconnected' | 'connecting' | 'connected';
|
||||
|
||||
interface ChannelState {
|
||||
status: ConnectionStatus;
|
||||
values: Record<string, string>;
|
||||
}
|
||||
|
||||
export default function ChannelConnectPage() {
|
||||
const navigate = useNavigate();
|
||||
const [channels, setChannels] = useState<Record<string, ChannelState>>(() => {
|
||||
const init: Record<string, ChannelState> = {};
|
||||
for (const ch of CHANNELS) {
|
||||
init[ch.id] = { status: 'disconnected', values: {} };
|
||||
}
|
||||
return init;
|
||||
});
|
||||
|
||||
const [expandedId, setExpandedId] = useState<string | null>(null);
|
||||
|
||||
const handleFieldChange = useCallback((channelId: string, fieldKey: string, value: string) => {
|
||||
setChannels(prev => ({
|
||||
...prev,
|
||||
[channelId]: {
|
||||
...prev[channelId],
|
||||
values: { ...prev[channelId].values, [fieldKey]: value },
|
||||
},
|
||||
}));
|
||||
}, []);
|
||||
|
||||
const handleConnect = useCallback((channelId: string) => {
|
||||
setChannels(prev => ({
|
||||
...prev,
|
||||
[channelId]: { ...prev[channelId], status: 'connecting' },
|
||||
}));
|
||||
// Simulate connection
|
||||
setTimeout(() => {
|
||||
setChannels(prev => ({
|
||||
...prev,
|
||||
[channelId]: { ...prev[channelId], status: 'connected' },
|
||||
}));
|
||||
}, 2000);
|
||||
}, []);
|
||||
|
||||
const handleDisconnect = useCallback((channelId: string) => {
|
||||
setChannels(prev => ({
|
||||
...prev,
|
||||
[channelId]: { status: 'disconnected', values: {} },
|
||||
}));
|
||||
}, []);
|
||||
|
||||
const connectedCount = (Object.values(channels) as ChannelState[]).filter(c => c.status === 'connected').length;
|
||||
|
||||
return (
|
||||
<div className="pt-20 min-h-screen">
|
||||
{/* Header */}
|
||||
<div className="bg-gradient-to-r from-[#fff3eb] via-[#e4cfff] to-[#f5f9ff] py-16 px-6">
|
||||
<div className="max-w-5xl mx-auto">
|
||||
<p className="text-xs font-semibold text-[#6C5CE7] tracking-widest uppercase mb-3">Channel Integration</p>
|
||||
<h1 className="font-serif text-3xl md:text-4xl font-bold text-[#021341] mb-3">
|
||||
채널 연결
|
||||
</h1>
|
||||
<p className="text-[#021341]/60 max-w-xl">
|
||||
소셜 미디어와 플랫폼을 연결하여 콘텐츠를 자동으로 배포하고 성과를 추적하세요.
|
||||
</p>
|
||||
|
||||
{/* Connection Summary + Distribute Button */}
|
||||
<div className="flex items-center gap-4 mt-8">
|
||||
<div className="flex items-center gap-2 px-4 py-2 rounded-full bg-white/70 backdrop-blur-sm border border-white/40">
|
||||
<div className={`w-3 h-3 rounded-full ${connectedCount > 0 ? 'bg-[#6C5CE7]' : 'bg-slate-300'}`} />
|
||||
<span className="text-sm font-medium text-[#021341]">
|
||||
{connectedCount} / {CHANNELS.length} 연결됨
|
||||
</span>
|
||||
</div>
|
||||
{connectedCount > 0 && (
|
||||
<button
|
||||
onClick={() => navigate('/distribute')}
|
||||
className="flex items-center gap-2 px-5 py-2 rounded-full bg-gradient-to-r from-[#4F1DA1] to-[#021341] text-white text-sm font-medium shadow-md hover:shadow-lg transition-all"
|
||||
>
|
||||
콘텐츠 배포하기
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
|
||||
<path d="M3 8h10M9 4l4 4-4 4" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
|
||||
</svg>
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Channel Grid */}
|
||||
<div className="max-w-5xl mx-auto px-6 py-12">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
{CHANNELS.map(ch => {
|
||||
const state = channels[ch.id];
|
||||
const isExpanded = expandedId === ch.id;
|
||||
const Icon = ch.icon;
|
||||
const allFieldsFilled = ch.fields.every(f => (state.values[f.key] ?? '').trim().length > 0);
|
||||
|
||||
return (
|
||||
<motion.div
|
||||
key={ch.id}
|
||||
layout
|
||||
className={`rounded-2xl border-2 overflow-hidden transition-all ${
|
||||
state.status === 'connected'
|
||||
? 'border-[#D5CDF5] bg-[#F3F0FF]/20'
|
||||
: isExpanded
|
||||
? 'border-[#6C5CE7] bg-white shadow-[3px_4px_12px_rgba(108,92,231,0.12)]'
|
||||
: 'border-slate-100 bg-white shadow-[3px_4px_12px_rgba(0,0,0,0.06)] hover:border-[#D5CDF5]'
|
||||
}`}
|
||||
>
|
||||
{/* Card Header */}
|
||||
<button
|
||||
onClick={() => setExpandedId(isExpanded ? null : ch.id)}
|
||||
className="w-full flex items-center gap-4 p-5 text-left"
|
||||
>
|
||||
<div
|
||||
className="w-11 h-11 rounded-xl flex items-center justify-center shrink-0"
|
||||
style={{ backgroundColor: ch.bgColor }}
|
||||
>
|
||||
<Icon size={22} style={{ color: ch.brandColor }} />
|
||||
</div>
|
||||
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center gap-2">
|
||||
<h3 className="font-semibold text-[#0A1128]">{ch.name}</h3>
|
||||
{state.status === 'connected' && (
|
||||
<span className="px-2 py-1 rounded-full bg-[#F3F0FF] text-[#4A3A7C] text-xs font-semibold border border-[#D5CDF5]">
|
||||
연결됨
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<p className="text-xs text-slate-500 mt-1 truncate">{ch.description}</p>
|
||||
</div>
|
||||
|
||||
<svg
|
||||
width="20" height="20" viewBox="0 0 20 20" fill="none"
|
||||
className={`shrink-0 text-slate-400 transition-transform ${isExpanded ? 'rotate-180' : ''}`}
|
||||
>
|
||||
<path d="M5 7.5L10 12.5L15 7.5" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
{/* Expanded Content */}
|
||||
<AnimatePresence>
|
||||
{isExpanded && (
|
||||
<motion.div
|
||||
initial={{ height: 0, opacity: 0 }}
|
||||
animate={{ height: 'auto', opacity: 1 }}
|
||||
exit={{ height: 0, opacity: 0 }}
|
||||
transition={{ duration: 0.25 }}
|
||||
className="overflow-hidden"
|
||||
>
|
||||
<div className="px-5 pb-5 pt-1 border-t border-slate-100">
|
||||
{state.status === 'connected' ? (
|
||||
<div>
|
||||
<div className="flex items-center gap-2 mb-4 mt-3">
|
||||
<div className="w-2 h-2 rounded-full bg-[#6C5CE7]" />
|
||||
<span className="text-sm text-[#4A3A7C] font-medium">연결 상태: 활성</span>
|
||||
</div>
|
||||
{ch.fields.map(f => (
|
||||
<div key={f.key} className="mb-2">
|
||||
<span className="text-xs text-slate-400">{f.label}</span>
|
||||
<p className="text-sm text-slate-700 font-medium">
|
||||
{f.type === 'password' ? '••••••••' : state.values[f.key]}
|
||||
</p>
|
||||
</div>
|
||||
))}
|
||||
<button
|
||||
onClick={() => handleDisconnect(ch.id)}
|
||||
className="mt-4 w-full py-3 rounded-full bg-white border border-[#F5D5DC] text-[#7C3A4B] text-sm font-medium hover:bg-[#FFF0F0] transition-all"
|
||||
>
|
||||
연결 해제
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
<div className="mt-3">
|
||||
{ch.fields.map(f => (
|
||||
<div key={f.key} className="mb-3">
|
||||
<label className="text-xs font-medium text-slate-600 mb-1 block">{f.label}</label>
|
||||
<input
|
||||
type={f.type ?? 'text'}
|
||||
value={state.values[f.key] ?? ''}
|
||||
onChange={e => handleFieldChange(ch.id, f.key, e.target.value)}
|
||||
placeholder={f.placeholder}
|
||||
className="w-full px-4 py-3 rounded-xl border border-slate-200 text-sm text-slate-700 placeholder:text-slate-300 focus:outline-none focus:border-[#6C5CE7] focus:ring-1 focus:ring-[#6C5CE7]/20 transition-all"
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
|
||||
<div className="flex gap-2 mt-4">
|
||||
<button
|
||||
onClick={() => handleConnect(ch.id)}
|
||||
disabled={!allFieldsFilled || state.status === 'connecting'}
|
||||
className="flex-1 flex items-center justify-center gap-2 py-3 rounded-full bg-gradient-to-r from-[#4F1DA1] to-[#021341] text-white text-sm font-medium shadow-md hover:shadow-lg transition-all disabled:opacity-40 disabled:cursor-not-allowed"
|
||||
>
|
||||
{state.status === 'connecting' ? (
|
||||
<>
|
||||
<div className="w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin" />
|
||||
연결 중...
|
||||
</>
|
||||
) : (
|
||||
'연결하기'
|
||||
)}
|
||||
</button>
|
||||
<button
|
||||
className="px-4 py-3 rounded-full bg-white border border-slate-200 text-slate-500 text-sm font-medium hover:bg-slate-50 transition-all"
|
||||
>
|
||||
OAuth
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</motion.div>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
</motion.div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import StudioWizard from '../components/studio/StudioWizard';
|
||||
|
||||
export default function ContentStudioPage() {
|
||||
return (
|
||||
<div className="pt-20">
|
||||
<StudioWizard />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,385 @@
|
||||
import { useState, useCallback } from 'react';
|
||||
import { motion, AnimatePresence } from 'motion/react';
|
||||
import {
|
||||
YoutubeFilled,
|
||||
InstagramFilled,
|
||||
FacebookFilled,
|
||||
GlobeFilled,
|
||||
TiktokFilled,
|
||||
VideoFilled,
|
||||
FileTextFilled,
|
||||
ShareFilled,
|
||||
} from '../components/icons/FilledIcons';
|
||||
import type { ComponentType } from 'react';
|
||||
|
||||
// ─── Types ───
|
||||
|
||||
type DistributeStatus = 'ready' | 'publishing' | 'published' | 'failed';
|
||||
|
||||
interface ChannelTarget {
|
||||
id: string;
|
||||
name: string;
|
||||
icon: ComponentType<{ size?: number; className?: string }>;
|
||||
brandColor: string;
|
||||
bgColor: string;
|
||||
connected: boolean;
|
||||
selected: boolean;
|
||||
status: DistributeStatus;
|
||||
format: string;
|
||||
}
|
||||
|
||||
// ─── Mock content from Studio ───
|
||||
|
||||
const MOCK_CONTENT = {
|
||||
title: '한번에 성공하는 코성형, VIEW의 비결',
|
||||
description: '코성형은 얼굴의 중심을 결정하는 중요한 수술입니다. VIEW 성형외과는 21년간 축적된 노하우를 바탕으로 자연스러운 결과를 만들어냅니다.',
|
||||
type: 'video' as const,
|
||||
duration: '0:58',
|
||||
aspectRatio: '9:16',
|
||||
tags: ['코성형', '뷰성형외과', '강남성형외과', '코수술', '자연스러운코'],
|
||||
thumbnail: null as string | null,
|
||||
};
|
||||
|
||||
const INITIAL_CHANNELS: ChannelTarget[] = [
|
||||
{ id: 'youtube', name: 'YouTube Shorts', icon: YoutubeFilled, brandColor: '#FF0000', bgColor: '#FFF0F0', connected: true, selected: true, status: 'ready', format: 'Shorts (9:16)' },
|
||||
{ id: 'instagram_kr', name: 'Instagram Reels', icon: InstagramFilled, brandColor: '#E1306C', bgColor: '#FFF0F5', connected: true, selected: true, status: 'ready', format: 'Reels (9:16)' },
|
||||
{ id: 'instagram_en', name: 'Instagram EN', icon: InstagramFilled, brandColor: '#E1306C', bgColor: '#FFF0F5', connected: true, selected: false, status: 'ready', format: 'Reels (9:16)' },
|
||||
{ id: 'tiktok', name: 'TikTok', icon: TiktokFilled, brandColor: '#000000', bgColor: '#F5F5F5', connected: true, selected: true, status: 'ready', format: 'Short Video (9:16)' },
|
||||
{ id: 'facebook_kr', name: 'Facebook KR', icon: FacebookFilled, brandColor: '#1877F2', bgColor: '#F0F4FF', connected: true, selected: false, status: 'ready', format: 'Video Post' },
|
||||
{ id: 'naver_blog', name: 'Naver Blog', icon: GlobeFilled, brandColor: '#03C75A', bgColor: '#F0FFF5', connected: false, selected: false, status: 'ready', format: 'Blog Post' },
|
||||
{ id: 'facebook_en', name: 'Facebook EN', icon: FacebookFilled, brandColor: '#1877F2', bgColor: '#F0F4FF', connected: false, selected: false, status: 'ready', format: 'Video Post' },
|
||||
];
|
||||
|
||||
// ─── Component ───
|
||||
|
||||
export default function DistributionPage() {
|
||||
const [channels, setChannels] = useState(INITIAL_CHANNELS);
|
||||
const [title, setTitle] = useState(MOCK_CONTENT.title);
|
||||
const [description, setDescription] = useState(MOCK_CONTENT.description);
|
||||
const [tags, setTags] = useState(MOCK_CONTENT.tags);
|
||||
const [scheduleMode, setScheduleMode] = useState<'now' | 'scheduled'>('now');
|
||||
const [scheduleDate, setScheduleDate] = useState('');
|
||||
const [scheduleHour, setScheduleHour] = useState(9);
|
||||
const [scheduleMinute, setScheduleMinute] = useState(0);
|
||||
const [schedulePeriod, setSchedulePeriod] = useState<'AM' | 'PM'>('AM');
|
||||
const [isPublishing, setIsPublishing] = useState(false);
|
||||
|
||||
const selectedChannels = channels.filter(c => c.connected && c.selected);
|
||||
const allPublished = selectedChannels.length > 0 && selectedChannels.every(c => c.status === 'published');
|
||||
|
||||
const toggleChannel = useCallback((id: string) => {
|
||||
setChannels(prev => prev.map(c =>
|
||||
c.id === id && c.connected ? { ...c, selected: !c.selected } : c
|
||||
));
|
||||
}, []);
|
||||
|
||||
const handlePublish = useCallback(() => {
|
||||
setIsPublishing(true);
|
||||
|
||||
// Simulate sequential publishing
|
||||
const selected = channels.filter(c => c.connected && c.selected);
|
||||
selected.forEach((ch, i) => {
|
||||
setTimeout(() => {
|
||||
setChannels(prev => prev.map(c =>
|
||||
c.id === ch.id ? { ...c, status: 'publishing' } : c
|
||||
));
|
||||
}, i * 1500);
|
||||
|
||||
setTimeout(() => {
|
||||
setChannels(prev => prev.map(c =>
|
||||
c.id === ch.id ? { ...c, status: 'published' } : c
|
||||
));
|
||||
if (i === selected.length - 1) setIsPublishing(false);
|
||||
}, (i + 1) * 1500 + 500);
|
||||
});
|
||||
}, [channels]);
|
||||
|
||||
return (
|
||||
<div className="pt-20 min-h-screen">
|
||||
{/* Header */}
|
||||
<div className="bg-[#0A1128] py-14 px-6 relative overflow-hidden">
|
||||
<div className="absolute top-0 right-0 w-[500px] h-[500px] rounded-full bg-[#6C5CE7]/10 blur-[120px]" />
|
||||
<div className="max-w-5xl mx-auto relative">
|
||||
<p className="text-xs font-semibold text-purple-300 tracking-widest uppercase mb-3">Content Distribution</p>
|
||||
<h1 className="font-serif text-3xl md:text-4xl font-bold text-white mb-3">
|
||||
콘텐츠 배포
|
||||
</h1>
|
||||
<p className="text-purple-200/70 max-w-xl">
|
||||
제작된 콘텐츠를 연결된 채널에 동시 배포합니다.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="max-w-5xl mx-auto px-6 py-10">
|
||||
<div className="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
||||
|
||||
{/* Left: Content Preview + Meta */}
|
||||
<div className="lg:col-span-1">
|
||||
<h3 className="font-serif font-bold text-xl text-[#0A1128] mb-4">콘텐츠</h3>
|
||||
|
||||
{/* Video Preview */}
|
||||
<div className="w-full aspect-[9/16] max-w-[220px] mx-auto rounded-2xl bg-gradient-to-br from-[#F3F0FF] via-white to-[#FFF6ED] border border-slate-200 flex flex-col items-center justify-center mb-6">
|
||||
<VideoFilled size={32} className="text-[#9B8AD4] mb-3" />
|
||||
<p className="text-xs text-slate-500">{MOCK_CONTENT.aspectRatio}</p>
|
||||
<p className="text-xs text-slate-400 mt-1">{MOCK_CONTENT.duration}</p>
|
||||
</div>
|
||||
|
||||
{/* Title */}
|
||||
<div className="mb-4">
|
||||
<label className="text-xs font-medium text-slate-600 mb-1 block">제목</label>
|
||||
<input
|
||||
value={title}
|
||||
onChange={e => setTitle(e.target.value)}
|
||||
className="w-full px-4 py-3 rounded-xl border border-slate-200 text-sm text-slate-700 focus:outline-none focus:border-[#6C5CE7] focus:ring-1 focus:ring-[#6C5CE7]/20 transition-all"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Description */}
|
||||
<div className="mb-4">
|
||||
<label className="text-xs font-medium text-slate-600 mb-1 block">설명</label>
|
||||
<textarea
|
||||
value={description}
|
||||
onChange={e => setDescription(e.target.value)}
|
||||
rows={4}
|
||||
className="w-full px-4 py-3 rounded-xl border border-slate-200 text-sm text-slate-700 resize-y focus:outline-none focus:border-[#6C5CE7] focus:ring-1 focus:ring-[#6C5CE7]/20 transition-all"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Tags */}
|
||||
<div>
|
||||
<label className="text-xs font-medium text-slate-600 mb-2 block">태그</label>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{tags.map(tag => (
|
||||
<span
|
||||
key={tag}
|
||||
className="px-3 py-1 rounded-full bg-[#F3F0FF] text-[#4A3A7C] text-xs font-medium border border-[#D5CDF5]"
|
||||
>
|
||||
#{tag}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Right: Channel Selection + Schedule + Publish */}
|
||||
<div className="lg:col-span-2">
|
||||
{/* Channel Selection */}
|
||||
<h3 className="font-serif font-bold text-xl text-[#0A1128] mb-4">배포 채널 선택</h3>
|
||||
|
||||
<div className="space-y-3 mb-8">
|
||||
{channels.map(ch => {
|
||||
const Icon = ch.icon;
|
||||
return (
|
||||
<motion.div
|
||||
key={ch.id}
|
||||
layout
|
||||
className={`flex items-center gap-4 p-4 rounded-2xl border-2 transition-all ${
|
||||
!ch.connected
|
||||
? 'border-slate-100 bg-slate-50/50 opacity-50'
|
||||
: ch.selected
|
||||
? 'border-[#6C5CE7] bg-[#F3F0FF]/20 shadow-[3px_4px_12px_rgba(108,92,231,0.08)]'
|
||||
: 'border-slate-100 bg-white shadow-[3px_4px_12px_rgba(0,0,0,0.04)] hover:border-[#D5CDF5]'
|
||||
}`}
|
||||
>
|
||||
{/* Checkbox */}
|
||||
<button
|
||||
onClick={() => toggleChannel(ch.id)}
|
||||
disabled={!ch.connected}
|
||||
className={`w-5 h-5 rounded border-2 flex items-center justify-center shrink-0 transition-all ${
|
||||
ch.selected && ch.connected
|
||||
? 'border-[#6C5CE7] bg-[#6C5CE7]'
|
||||
: 'border-slate-300 bg-white'
|
||||
} disabled:cursor-not-allowed`}
|
||||
>
|
||||
{ch.selected && ch.connected && (
|
||||
<svg width="10" height="10" viewBox="0 0 14 14" fill="none">
|
||||
<path d="M2 7L5.5 10.5L12 3.5" stroke="white" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" />
|
||||
</svg>
|
||||
)}
|
||||
</button>
|
||||
|
||||
{/* Icon */}
|
||||
<div
|
||||
className="w-10 h-10 rounded-xl flex items-center justify-center shrink-0"
|
||||
style={{ backgroundColor: ch.bgColor }}
|
||||
>
|
||||
<Icon size={20} style={{ color: ch.brandColor }} />
|
||||
</div>
|
||||
|
||||
{/* Info */}
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-sm font-semibold text-[#0A1128]">{ch.name}</span>
|
||||
{!ch.connected && (
|
||||
<span className="px-2 py-1 rounded-full bg-[#FFF6ED] text-[#7C5C3A] text-xs font-semibold border border-[#F5E0C5]">
|
||||
미연결
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<p className="text-xs text-slate-400">{ch.format}</p>
|
||||
</div>
|
||||
|
||||
{/* Status */}
|
||||
<div className="shrink-0">
|
||||
{ch.status === 'publishing' && (
|
||||
<div className="w-5 h-5 border-2 border-[#6C5CE7] border-t-transparent rounded-full animate-spin" />
|
||||
)}
|
||||
{ch.status === 'published' && (
|
||||
<div className="w-6 h-6 rounded-full bg-[#6C5CE7] flex items-center justify-center">
|
||||
<svg width="12" height="12" viewBox="0 0 14 14" fill="none">
|
||||
<path d="M2 7L5.5 10.5L12 3.5" stroke="white" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
|
||||
</svg>
|
||||
</div>
|
||||
)}
|
||||
{ch.status === 'failed' && (
|
||||
<div className="w-6 h-6 rounded-full bg-[#FFF0F0] flex items-center justify-center border border-[#F5D5DC]">
|
||||
<span className="text-[#7C3A4B] text-xs font-bold">!</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</motion.div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* Schedule */}
|
||||
<h3 className="font-serif font-bold text-xl text-[#0A1128] mb-4">배포 시간</h3>
|
||||
<div className="flex gap-2 mb-4">
|
||||
{([
|
||||
{ key: 'now' as const, label: '즉시 배포' },
|
||||
{ key: 'scheduled' as const, label: '예약 배포' },
|
||||
]).map(opt => (
|
||||
<button
|
||||
key={opt.key}
|
||||
onClick={() => setScheduleMode(opt.key)}
|
||||
className={`px-5 py-3 rounded-full text-sm font-medium transition-all ${
|
||||
scheduleMode === opt.key
|
||||
? 'bg-gradient-to-r from-[#4F1DA1] to-[#021341] text-white shadow-md'
|
||||
: 'bg-white border border-slate-200 text-slate-600 hover:bg-slate-50'
|
||||
}`}
|
||||
>
|
||||
{opt.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{scheduleMode === 'scheduled' && (
|
||||
<div className="mb-6 space-y-4">
|
||||
{/* Date */}
|
||||
<div>
|
||||
<label className="text-xs font-medium text-slate-600 mb-2 block">날짜</label>
|
||||
<input
|
||||
type="date"
|
||||
value={scheduleDate}
|
||||
onChange={e => setScheduleDate(e.target.value)}
|
||||
className="w-full px-4 py-3 rounded-xl border border-slate-200 text-sm text-slate-700 focus:outline-none focus:border-[#6C5CE7] transition-all appearance-none"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Custom Time Picker */}
|
||||
<div>
|
||||
<label className="text-xs font-medium text-slate-600 mb-2 block">시간</label>
|
||||
<div className="flex items-center gap-3">
|
||||
{/* Hour */}
|
||||
<div className="flex items-center gap-1">
|
||||
<button
|
||||
onClick={() => setScheduleHour(h => h <= 1 ? 12 : h - 1)}
|
||||
className="w-8 h-8 rounded-lg bg-slate-50 border border-slate-200 flex items-center justify-center text-slate-500 hover:bg-slate-100 transition-all"
|
||||
>
|
||||
<svg width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M2 6h8M6 2l-4 4 4 4" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" /></svg>
|
||||
</button>
|
||||
<div className="w-12 h-10 rounded-xl bg-[#F3F0FF] border border-[#D5CDF5] flex items-center justify-center text-lg font-semibold text-[#0A1128]">
|
||||
{String(scheduleHour).padStart(2, '0')}
|
||||
</div>
|
||||
<button
|
||||
onClick={() => setScheduleHour(h => h >= 12 ? 1 : h + 1)}
|
||||
className="w-8 h-8 rounded-lg bg-slate-50 border border-slate-200 flex items-center justify-center text-slate-500 hover:bg-slate-100 transition-all"
|
||||
>
|
||||
<svg width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M10 6H2M6 10l4-4-4-4" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" /></svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<span className="text-xl font-bold text-slate-300">:</span>
|
||||
|
||||
{/* Minute */}
|
||||
<div className="flex items-center gap-1">
|
||||
<button
|
||||
onClick={() => setScheduleMinute(m => m <= 0 ? 55 : m - 5)}
|
||||
className="w-8 h-8 rounded-lg bg-slate-50 border border-slate-200 flex items-center justify-center text-slate-500 hover:bg-slate-100 transition-all"
|
||||
>
|
||||
<svg width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M2 6h8M6 2l-4 4 4 4" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" /></svg>
|
||||
</button>
|
||||
<div className="w-12 h-10 rounded-xl bg-[#F3F0FF] border border-[#D5CDF5] flex items-center justify-center text-lg font-semibold text-[#0A1128]">
|
||||
{String(scheduleMinute).padStart(2, '0')}
|
||||
</div>
|
||||
<button
|
||||
onClick={() => setScheduleMinute(m => m >= 55 ? 0 : m + 5)}
|
||||
className="w-8 h-8 rounded-lg bg-slate-50 border border-slate-200 flex items-center justify-center text-slate-500 hover:bg-slate-100 transition-all"
|
||||
>
|
||||
<svg width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M10 6H2M6 10l4-4-4-4" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" /></svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* AM/PM */}
|
||||
<div className="flex rounded-xl overflow-hidden border border-slate-200">
|
||||
{(['AM', 'PM'] as const).map(p => (
|
||||
<button
|
||||
key={p}
|
||||
onClick={() => setSchedulePeriod(p)}
|
||||
className={`px-4 py-2 text-sm font-medium transition-all ${
|
||||
schedulePeriod === p
|
||||
? 'bg-gradient-to-r from-[#4F1DA1] to-[#021341] text-white'
|
||||
: 'bg-white text-slate-500 hover:bg-slate-50'
|
||||
}`}
|
||||
>
|
||||
{p}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Publish Button */}
|
||||
{!allPublished ? (
|
||||
<button
|
||||
onClick={handlePublish}
|
||||
disabled={selectedChannels.length === 0 || isPublishing}
|
||||
className="w-full flex items-center justify-center gap-2 py-4 rounded-full bg-gradient-to-r from-[#4F1DA1] to-[#021341] text-white text-sm font-medium shadow-md hover:shadow-lg transition-all disabled:opacity-40 disabled:cursor-not-allowed"
|
||||
>
|
||||
{isPublishing ? (
|
||||
<>
|
||||
<div className="w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin" />
|
||||
배포 중... ({selectedChannels.filter(c => c.status === 'published').length}/{selectedChannels.length})
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<ShareFilled size={18} className="text-white" />
|
||||
{selectedChannels.length}개 채널에 {scheduleMode === 'now' ? '즉시 배포' : '예약 배포'}
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
) : (
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 10 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
className="w-full py-6 rounded-2xl bg-[#F3F0FF] border border-[#D5CDF5] text-center"
|
||||
>
|
||||
<div className="w-12 h-12 rounded-full bg-[#6C5CE7] flex items-center justify-center mx-auto mb-3">
|
||||
<svg width="20" height="20" viewBox="0 0 14 14" fill="none">
|
||||
<path d="M2 7L5.5 10.5L12 3.5" stroke="white" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
|
||||
</svg>
|
||||
</div>
|
||||
<p className="text-lg font-semibold text-[#0A1128] mb-1">배포 완료</p>
|
||||
<p className="text-sm text-[#4A3A7C]">
|
||||
{selectedChannels.length}개 채널에 성공적으로 배포되었습니다
|
||||
</p>
|
||||
</motion.div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import Hero from '../components/Hero';
|
||||
import TargetAudience from '../components/TargetAudience';
|
||||
import Problems from '../components/Problems';
|
||||
import Solution from '../components/Solution';
|
||||
import Modules from '../components/Modules';
|
||||
import UseCases from '../components/UseCases';
|
||||
import CTA from '../components/CTA';
|
||||
|
||||
export default function LandingPage() {
|
||||
return (
|
||||
<main>
|
||||
<Hero />
|
||||
<TargetAudience />
|
||||
<Problems />
|
||||
<Solution />
|
||||
<Modules />
|
||||
<UseCases />
|
||||
<CTA />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
import { useParams } from 'react-router';
|
||||
import { useMarketingPlan } from '../hooks/useMarketingPlan';
|
||||
import { ReportNav } from '../components/report/ReportNav';
|
||||
|
||||
// Plan section components
|
||||
import PlanHeader from '../components/plan/PlanHeader';
|
||||
import BrandingGuide from '../components/plan/BrandingGuide';
|
||||
import ChannelStrategy from '../components/plan/ChannelStrategy';
|
||||
import ContentStrategy from '../components/plan/ContentStrategy';
|
||||
import ContentCalendar from '../components/plan/ContentCalendar';
|
||||
import AssetCollection from '../components/plan/AssetCollection';
|
||||
import MyAssetUpload from '../components/plan/MyAssetUpload';
|
||||
import PlanCTA from '../components/plan/PlanCTA';
|
||||
|
||||
const PLAN_SECTIONS = [
|
||||
{ id: 'branding-guide', label: '브랜딩 가이드' },
|
||||
{ id: 'channel-strategy', label: '채널 전략' },
|
||||
{ id: 'content-strategy', label: '콘텐츠 전략' },
|
||||
{ id: 'content-calendar', label: '콘텐츠 캘린더' },
|
||||
{ id: 'asset-collection', label: '에셋 수집' },
|
||||
{ id: 'my-asset-upload', label: 'My Assets' },
|
||||
];
|
||||
|
||||
export default function MarketingPlanPage() {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const { data, isLoading, error } = useMarketingPlan(id);
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center pt-20">
|
||||
<div className="flex flex-col items-center gap-4">
|
||||
<div className="w-10 h-10 border-4 border-[#6C5CE7] border-t-transparent rounded-full animate-spin" />
|
||||
<p className="text-slate-500 text-sm">마케팅 플랜을 불러오는 중...</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (error || !data) {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center pt-20">
|
||||
<div className="text-center">
|
||||
<p className="text-[#7C3A4B] font-medium mb-2">오류가 발생했습니다</p>
|
||||
<p className="text-slate-500 text-sm">
|
||||
{error ?? '마케팅 플랜을 찾을 수 없습니다.'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="pt-20">
|
||||
<ReportNav sections={PLAN_SECTIONS} />
|
||||
|
||||
<div data-plan-content>
|
||||
<PlanHeader
|
||||
clinicName={data.clinicName}
|
||||
clinicNameEn={data.clinicNameEn}
|
||||
date={data.createdAt}
|
||||
targetUrl={data.targetUrl}
|
||||
/>
|
||||
|
||||
<BrandingGuide data={data.brandGuide} />
|
||||
|
||||
<ChannelStrategy channels={data.channelStrategies} />
|
||||
|
||||
<ContentStrategy data={data.contentStrategy} />
|
||||
|
||||
<ContentCalendar data={data.calendar} />
|
||||
|
||||
<AssetCollection data={data.assetCollection} />
|
||||
|
||||
<div data-no-print>
|
||||
<MyAssetUpload />
|
||||
</div>
|
||||
|
||||
<PlanCTA />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,499 @@
|
||||
import { useState } from 'react';
|
||||
import { motion } from 'motion/react';
|
||||
import {
|
||||
YoutubeFilled,
|
||||
InstagramFilled,
|
||||
FacebookFilled,
|
||||
GlobeFilled,
|
||||
TiktokFilled,
|
||||
VideoFilled,
|
||||
FileTextFilled,
|
||||
ShareFilled,
|
||||
} from '../components/icons/FilledIcons';
|
||||
import type { ComponentType } from 'react';
|
||||
|
||||
// ─── Types ───
|
||||
|
||||
interface ChannelMetric {
|
||||
id: string;
|
||||
name: string;
|
||||
icon: ComponentType<{ size?: number; className?: string }>;
|
||||
brandColor: string;
|
||||
bgColor: string;
|
||||
followers: string;
|
||||
followersDelta: string;
|
||||
views: string;
|
||||
viewsDelta: string;
|
||||
engagement: string;
|
||||
engagementDelta: string;
|
||||
posts: number;
|
||||
score: number;
|
||||
}
|
||||
|
||||
interface ContentPerformance {
|
||||
id: string;
|
||||
title: string;
|
||||
channel: string;
|
||||
type: 'video' | 'blog' | 'social';
|
||||
views: string;
|
||||
likes: string;
|
||||
comments: string;
|
||||
ctr: string;
|
||||
publishedAt: string;
|
||||
}
|
||||
|
||||
// ─── Mock Data ───
|
||||
|
||||
const CHANNELS: ChannelMetric[] = [
|
||||
{ id: 'youtube', name: 'YouTube', icon: YoutubeFilled, brandColor: '#FF0000', bgColor: '#FFF0F0', followers: '103K', followersDelta: '+2.1K', views: '270K', viewsDelta: '+18%', engagement: '4.2%', engagementDelta: '+0.8%', posts: 12, score: 65 },
|
||||
{ id: 'instagram_kr', name: 'Instagram KR', icon: InstagramFilled, brandColor: '#E1306C', bgColor: '#FFF0F5', followers: '14K', followersDelta: '+890', views: '45K', viewsDelta: '+32%', engagement: '3.1%', engagementDelta: '+1.2%', posts: 24, score: 35 },
|
||||
{ id: 'instagram_en', name: 'Instagram EN', icon: InstagramFilled, brandColor: '#E1306C', bgColor: '#FFF0F5', followers: '68.8K', followersDelta: '+1.2K', views: '120K', viewsDelta: '+8%', engagement: '5.6%', engagementDelta: '+0.3%', posts: 18, score: 55 },
|
||||
{ id: 'tiktok', name: 'TikTok', icon: TiktokFilled, brandColor: '#000000', bgColor: '#F5F5F5', followers: '0', followersDelta: 'NEW', views: '0', viewsDelta: '-', engagement: '0%', engagementDelta: '-', posts: 0, score: 0 },
|
||||
{ id: 'facebook', name: 'Facebook', icon: FacebookFilled, brandColor: '#1877F2', bgColor: '#F0F4FF', followers: '341', followersDelta: '+12', views: '2.1K', viewsDelta: '-5%', engagement: '0.8%', engagementDelta: '-0.2%', posts: 6, score: 40 },
|
||||
{ id: 'naver', name: 'Naver Blog', icon: GlobeFilled, brandColor: '#03C75A', bgColor: '#F0FFF5', followers: '-', followersDelta: '-', views: '8.2K', viewsDelta: '+45%', engagement: '2.4%', engagementDelta: '+1.1%', posts: 8, score: 72 },
|
||||
];
|
||||
|
||||
const TOP_CONTENT: ContentPerformance[] = [
|
||||
{ id: '1', title: '한번에 성공하는 코성형, VIEW의 비결', channel: 'YouTube', type: 'video', views: '12.4K', likes: '342', comments: '28', ctr: '8.2%', publishedAt: '3일 전' },
|
||||
{ id: '2', title: '안면윤곽 수술 종류와 회복기간', channel: 'Naver Blog', type: 'blog', views: '3.2K', likes: '-', comments: '12', ctr: '12.5%', publishedAt: '5일 전' },
|
||||
{ id: '3', title: 'Reel: 윤곽 전후 변화', channel: 'Instagram KR', type: 'social', views: '8.7K', likes: '567', comments: '45', ctr: '6.1%', publishedAt: '2일 전' },
|
||||
{ id: '4', title: 'Shorts: 사각턱 축소 과정', channel: 'YouTube', type: 'video', views: '5.1K', likes: '189', comments: '15', ctr: '4.8%', publishedAt: '4일 전' },
|
||||
{ id: '5', title: '코성형 가이드: 내 얼굴에 맞는 코', channel: 'Naver Blog', type: 'blog', views: '2.8K', likes: '-', comments: '8', ctr: '15.2%', publishedAt: '6일 전' },
|
||||
];
|
||||
|
||||
const OVERVIEW_STATS = [
|
||||
{ label: '총 노출', value: '445K', delta: '+24%', positive: true },
|
||||
{ label: '총 조회', value: '89.2K', delta: '+18%', positive: true },
|
||||
{ label: '평균 참여율', value: '3.8%', delta: '+0.6%', positive: true },
|
||||
{ label: '콘텐츠 발행', value: '68건', delta: '+12건', positive: true },
|
||||
{ label: '신규 팔로워', value: '+4.3K', delta: '+32%', positive: true },
|
||||
{ label: '전환 (상담)', value: '47건', delta: '+15건', positive: true },
|
||||
];
|
||||
|
||||
// ─── Funnel Data ───
|
||||
|
||||
const FUNNEL_STEPS = [
|
||||
{ label: '노출', labelEn: 'Impressions', value: 445000, display: '445K', color: '#6C5CE7' },
|
||||
{ label: '클릭', labelEn: 'Clicks', value: 89200, display: '89.2K', color: '#7C6DD8' },
|
||||
{ label: '웹사이트 유입', labelEn: 'Website Visits', value: 12400, display: '12.4K', color: '#9B8AD4' },
|
||||
{ label: '상담 문의', labelEn: 'Inquiries', value: 478, display: '478', color: '#B8A9E8' },
|
||||
{ label: '예약 전환', labelEn: 'Conversions', value: 47, display: '47', color: '#D5CDF5' },
|
||||
];
|
||||
|
||||
// ─── Channel Trend Data (4 weeks) ───
|
||||
|
||||
const CHANNEL_TREND = [
|
||||
{ week: 'W1', youtube: 85, instagram: 32, naver: 18, facebook: 8 },
|
||||
{ week: 'W2', youtube: 92, instagram: 41, naver: 24, facebook: 7 },
|
||||
{ week: 'W3', youtube: 78, instagram: 55, naver: 31, facebook: 9 },
|
||||
{ week: 'W4', youtube: 105, instagram: 68, naver: 38, facebook: 6 },
|
||||
];
|
||||
|
||||
const TREND_CHANNELS = [
|
||||
{ key: 'youtube' as const, label: 'YouTube', color: 'rgba(155,138,212,0.35)' },
|
||||
{ key: 'instagram' as const, label: 'Instagram', color: 'rgba(212,168,186,0.3)' },
|
||||
{ key: 'naver' as const, label: 'Naver', color: 'rgba(160,200,180,0.3)' },
|
||||
{ key: 'facebook' as const, label: 'Facebook', color: 'rgba(160,180,220,0.25)' },
|
||||
];
|
||||
|
||||
// ─── Heatmap Data (Day × Time Slot) ───
|
||||
|
||||
const DAYS = ['월', '화', '수', '목', '금', '토', '일'];
|
||||
const TIME_SLOTS = ['오전 (6-12)', '오후 (12-18)', '저녁 (18-24)', '심야 (0-6)'];
|
||||
|
||||
// Engagement rate by day × time slot (0-10 scale)
|
||||
const HEATMAP_DATA = [
|
||||
[3, 7, 8, 2], // 월
|
||||
[4, 6, 9, 1], // 화
|
||||
[5, 8, 7, 2], // 수
|
||||
[6, 9, 8, 1], // 목
|
||||
[4, 7, 10, 3], // 금
|
||||
[2, 5, 6, 4], // 토
|
||||
[1, 4, 5, 3], // 일
|
||||
];
|
||||
|
||||
// ─── Component ───
|
||||
|
||||
const typeIcons: Record<string, ComponentType<{ size?: number; className?: string }>> = {
|
||||
video: VideoFilled,
|
||||
blog: FileTextFilled,
|
||||
social: ShareFilled,
|
||||
};
|
||||
|
||||
const typeColors: Record<string, { bg: string; text: string }> = {
|
||||
video: { bg: 'bg-[#F3F0FF]', text: 'text-[#4A3A7C]' },
|
||||
blog: { bg: 'bg-[#EFF0FF]', text: 'text-[#3A3F7C]' },
|
||||
social: { bg: 'bg-[#FFF6ED]', text: 'text-[#7C5C3A]' },
|
||||
};
|
||||
|
||||
function heatmapColor(value: number): string {
|
||||
if (value >= 9) return 'bg-[#2d2640] text-white';
|
||||
if (value >= 7) return 'bg-[#4a4460] text-white';
|
||||
if (value >= 5) return 'bg-[#8e89a8] text-white';
|
||||
if (value >= 3) return 'bg-[#c8c4d8] text-[#4a4460]';
|
||||
return 'bg-[#f0eef5] text-[#8e89a8]';
|
||||
}
|
||||
|
||||
export default function PerformancePage() {
|
||||
const [period, setPeriod] = useState<'7d' | '30d' | '90d'>('30d');
|
||||
|
||||
const funnelMax = FUNNEL_STEPS[0].value;
|
||||
const trendMax = Math.max(...CHANNEL_TREND.flatMap(w => [w.youtube, w.instagram, w.naver, w.facebook]));
|
||||
|
||||
return (
|
||||
<div className="pt-20 min-h-screen">
|
||||
{/* Header */}
|
||||
<div className="bg-[#0A1128] py-14 px-6 relative overflow-hidden">
|
||||
<div className="absolute top-0 right-0 w-[500px] h-[500px] rounded-full bg-[#6C5CE7]/10 blur-[120px]" />
|
||||
<div className="absolute bottom-0 left-0 w-[300px] h-[300px] rounded-full bg-purple-500/5 blur-[100px]" />
|
||||
<div className="max-w-6xl mx-auto relative">
|
||||
<p className="text-xs font-semibold text-purple-300 tracking-widest uppercase mb-3">Performance Intelligence</p>
|
||||
<h1 className="font-serif text-3xl md:text-4xl font-bold text-white mb-3">성과 대시보드</h1>
|
||||
<p className="text-purple-200/70 max-w-xl mb-8">모든 채널의 마케팅 성과를 실시간으로 모니터링합니다.</p>
|
||||
<div className="flex gap-2">
|
||||
{([
|
||||
{ key: '7d' as const, label: '7일' },
|
||||
{ key: '30d' as const, label: '30일' },
|
||||
{ key: '90d' as const, label: '90일' },
|
||||
]).map(p => (
|
||||
<button
|
||||
key={p.key}
|
||||
onClick={() => setPeriod(p.key)}
|
||||
className={`px-4 py-2 rounded-full text-sm font-medium transition-all ${
|
||||
period === p.key ? 'bg-white text-[#0A1128]' : 'bg-white/10 text-purple-200 hover:bg-white/20'
|
||||
}`}
|
||||
>
|
||||
{p.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="max-w-6xl mx-auto px-6 py-10">
|
||||
|
||||
{/* Overview Stats */}
|
||||
<div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3 mb-10">
|
||||
{OVERVIEW_STATS.map((stat, i) => (
|
||||
<motion.div
|
||||
key={stat.label}
|
||||
className="bg-white rounded-2xl border border-slate-100 shadow-[3px_4px_12px_rgba(0,0,0,0.06)] p-4"
|
||||
initial={{ opacity: 0, y: 15 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ duration: 0.3, delay: i * 0.05 }}
|
||||
>
|
||||
<p className="text-xs text-slate-500 mb-1">{stat.label}</p>
|
||||
<p className="text-xl font-bold text-[#0A1128]">{stat.value}</p>
|
||||
<p className={`text-xs font-medium mt-1 ${stat.positive ? 'text-[#4A3A7C]' : 'text-[#7C3A4B]'}`}>{stat.delta}</p>
|
||||
</motion.div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* ═══ Section 1: Marketing Funnel ═══ */}
|
||||
<div className="bg-white rounded-2xl border border-slate-100 shadow-[3px_4px_12px_rgba(0,0,0,0.06)] p-6 mb-10">
|
||||
<div className="flex items-center justify-between mb-6">
|
||||
<div>
|
||||
<h3 className="font-serif font-bold text-xl text-[#0A1128]">마케팅 퍼널</h3>
|
||||
<p className="text-xs text-slate-500 mt-1">노출부터 전환까지 — 어디서 이탈하는지 파악</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-3">
|
||||
{FUNNEL_STEPS.map((step, i) => {
|
||||
const widthPct = Math.max((step.value / funnelMax) * 100, 8);
|
||||
const convRate = i > 0
|
||||
? ((step.value / FUNNEL_STEPS[i - 1].value) * 100).toFixed(1)
|
||||
: null;
|
||||
|
||||
return (
|
||||
<motion.div
|
||||
key={step.label}
|
||||
className="flex items-center gap-4"
|
||||
initial={{ opacity: 0, x: -20 }}
|
||||
animate={{ opacity: 1, x: 0 }}
|
||||
transition={{ duration: 0.4, delay: i * 0.1 }}
|
||||
>
|
||||
{/* Label */}
|
||||
<div className="w-24 shrink-0 text-right">
|
||||
<p className="text-sm font-medium text-[#0A1128]">{step.label}</p>
|
||||
<p className="text-xs text-slate-400">{step.labelEn}</p>
|
||||
</div>
|
||||
|
||||
{/* Bar */}
|
||||
<div className="flex-1 relative">
|
||||
<motion.div
|
||||
className="h-10 rounded-xl flex items-center px-4"
|
||||
style={{ backgroundColor: step.color }}
|
||||
initial={{ width: 0 }}
|
||||
animate={{ width: `${widthPct}%` }}
|
||||
transition={{ duration: 0.7, delay: i * 0.12 }}
|
||||
>
|
||||
<span className="text-sm font-bold text-white whitespace-nowrap">{step.display}</span>
|
||||
</motion.div>
|
||||
</div>
|
||||
|
||||
{/* Conversion Rate */}
|
||||
<div className="w-16 shrink-0 text-right">
|
||||
{convRate ? (
|
||||
<span className={`text-xs font-semibold px-2 py-1 rounded-full ${
|
||||
parseFloat(convRate) >= 10
|
||||
? 'bg-[#F3F0FF] text-[#4A3A7C]'
|
||||
: 'bg-[#FFF6ED] text-[#7C5C3A]'
|
||||
}`}>
|
||||
{convRate}%
|
||||
</span>
|
||||
) : (
|
||||
<span className="text-xs text-slate-300">—</span>
|
||||
)}
|
||||
</div>
|
||||
</motion.div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* Funnel insight */}
|
||||
<div className="mt-6 p-4 rounded-xl bg-[#FFF6ED] border border-[#F5E0C5]">
|
||||
<p className="text-sm text-[#7C5C3A]">
|
||||
<span className="font-semibold">병목 구간:</span> 클릭 → 웹사이트 유입 전환율 <span className="font-bold">13.9%</span> — 랜딩 페이지 최적화가 필요합니다. 업계 평균 20% 대비 낮음.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* ═══ Section 2: Channel Trend (Stacked Bar) ═══ */}
|
||||
<div className="bg-white rounded-2xl border border-slate-100 shadow-[3px_4px_12px_rgba(0,0,0,0.06)] p-6 mb-10">
|
||||
<div className="flex items-center justify-between mb-6">
|
||||
<div>
|
||||
<h3 className="font-serif font-bold text-xl text-[#0A1128]">채널별 주간 트렌드</h3>
|
||||
<p className="text-xs text-slate-500 mt-1">채널별 조회수 추이 비교 (단위: K)</p>
|
||||
</div>
|
||||
{/* Legend */}
|
||||
<div className="flex gap-3">
|
||||
{TREND_CHANNELS.map(ch => (
|
||||
<div key={ch.key} className="flex items-center gap-2">
|
||||
<div className="w-3 h-3 rounded-full" style={{ backgroundColor: ch.color }} />
|
||||
<span className="text-xs text-slate-500">{ch.label}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-end justify-center gap-10 h-[220px] px-8">
|
||||
{CHANNEL_TREND.map((week, wi) => {
|
||||
const total = week.youtube + week.instagram + week.naver + week.facebook;
|
||||
return (
|
||||
<div key={week.week} className="flex flex-col items-center gap-2" style={{ width: '80px' }}>
|
||||
{/* Total label above bar */}
|
||||
<p className="text-xs text-slate-500 font-medium">{total}K</p>
|
||||
{/* Stacked bar */}
|
||||
<div className="w-full flex flex-col-reverse items-stretch rounded-xl overflow-hidden" style={{ height: `${(total / (trendMax * 1.5)) * 160}px` }}>
|
||||
{TREND_CHANNELS.map(ch => {
|
||||
const val = week[ch.key];
|
||||
const segH = (val / total) * 100;
|
||||
return (
|
||||
<motion.div
|
||||
key={ch.key}
|
||||
className="w-full relative group"
|
||||
style={{ height: `${segH}%`, backgroundColor: ch.color }}
|
||||
initial={{ scaleY: 0 }}
|
||||
animate={{ scaleY: 1 }}
|
||||
transition={{ duration: 0.5, delay: wi * 0.1 }}
|
||||
>
|
||||
<div className="absolute -top-8 left-1/2 -translate-x-1/2 hidden group-hover:block bg-[#0A1128] text-white text-xs px-2 py-1 rounded whitespace-nowrap z-10">
|
||||
{ch.label}: {val}K
|
||||
</div>
|
||||
</motion.div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
{/* Week label */}
|
||||
<p className="text-xs font-medium text-slate-600">{week.week}</p>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* Trend insight */}
|
||||
<div className="mt-6 p-4 rounded-xl bg-[#F3F0FF] border border-[#D5CDF5]">
|
||||
<p className="text-sm text-[#4A3A7C]">
|
||||
<span className="font-semibold">성장 채널:</span> Instagram 조회수 <span className="font-bold">+112%</span> (W1→W4). Naver Blog <span className="font-bold">+111%</span> 동반 성장. YouTube는 안정적 유지.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* ═══ Section 3: Day × Time Heatmap ═══ */}
|
||||
<div className="bg-white rounded-2xl border border-slate-100 shadow-[3px_4px_12px_rgba(0,0,0,0.06)] p-6 mb-10">
|
||||
<div className="flex items-center justify-between mb-6">
|
||||
<div>
|
||||
<h3 className="font-serif font-bold text-xl text-[#0A1128]">최적 게시 시간</h3>
|
||||
<p className="text-xs text-slate-500 mt-1">요일×시간대별 참여율 히트맵 — 진할수록 성과가 높음</p>
|
||||
</div>
|
||||
{/* Scale legend */}
|
||||
<div className="flex items-center gap-1">
|
||||
<span className="text-xs text-slate-400">낮음</span>
|
||||
{[1, 3, 5, 7, 9].map(v => (
|
||||
<div key={v} className={`w-4 h-4 rounded ${heatmapColor(v)}`} />
|
||||
))}
|
||||
<span className="text-xs text-slate-400">높음</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Heatmap grid */}
|
||||
<div className="overflow-x-auto">
|
||||
<div className="min-w-[500px]">
|
||||
{/* Time slot headers */}
|
||||
<div className="grid grid-cols-[60px_repeat(4,1fr)] gap-2 mb-2">
|
||||
<div />
|
||||
{TIME_SLOTS.map(slot => (
|
||||
<div key={slot} className="text-center text-xs text-slate-500 font-medium">{slot}</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Rows */}
|
||||
{DAYS.map((day, di) => (
|
||||
<motion.div
|
||||
key={day}
|
||||
className="grid grid-cols-[60px_repeat(4,1fr)] gap-2 mb-2"
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
transition={{ duration: 0.3, delay: di * 0.05 }}
|
||||
>
|
||||
<div className="flex items-center justify-center text-sm font-medium text-[#0A1128]">{day}</div>
|
||||
{HEATMAP_DATA[di].map((val, ti) => (
|
||||
<div
|
||||
key={ti}
|
||||
className={`h-12 rounded-xl flex items-center justify-center text-sm font-semibold transition-all hover:scale-105 cursor-default ${heatmapColor(val)}`}
|
||||
>
|
||||
{val > 0 ? `${val * 10}%` : '-'}
|
||||
</div>
|
||||
))}
|
||||
</motion.div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Heatmap insight */}
|
||||
<div className="mt-6 p-4 rounded-xl bg-[#F3F0FF] border border-[#D5CDF5]">
|
||||
<p className="text-sm text-[#4A3A7C]">
|
||||
<span className="font-semibold">최적 시간:</span> <span className="font-bold">금요일 저녁 (18-24시)</span> 참여율 최고. 평일 오후 (12-18시)가 전반적으로 높음. 주말 오전은 피하세요.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Channel Performance Grid */}
|
||||
<h3 className="font-serif font-bold text-xl text-[#0A1128] mb-4">채널별 성과</h3>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-10">
|
||||
{CHANNELS.map((ch, i) => {
|
||||
const Icon = ch.icon;
|
||||
return (
|
||||
<motion.div
|
||||
key={ch.id}
|
||||
className="bg-white rounded-2xl border border-slate-100 shadow-[3px_4px_12px_rgba(0,0,0,0.06)] p-5"
|
||||
initial={{ opacity: 0, y: 15 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ duration: 0.3, delay: i * 0.08 }}
|
||||
>
|
||||
<div className="flex items-center gap-3 mb-4">
|
||||
<div className="w-10 h-10 rounded-xl flex items-center justify-center" style={{ backgroundColor: ch.bgColor }}>
|
||||
<Icon size={20} style={{ color: ch.brandColor }} />
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<h4 className="text-sm font-semibold text-[#0A1128]">{ch.name}</h4>
|
||||
<p className="text-xs text-slate-400">{ch.posts}개 콘텐츠</p>
|
||||
</div>
|
||||
<div className={`w-10 h-10 rounded-full flex items-center justify-center text-sm font-bold ${
|
||||
ch.score >= 70 ? 'bg-[#F3F0FF] text-[#4A3A7C]' :
|
||||
ch.score >= 40 ? 'bg-[#FFF6ED] text-[#7C5C3A]' :
|
||||
ch.score > 0 ? 'bg-[#FFF0F0] text-[#7C3A4B]' :
|
||||
'bg-slate-50 text-slate-400'
|
||||
}`}>
|
||||
{ch.score || '-'}
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid grid-cols-3 gap-3">
|
||||
<MetricCell label="팔로워" value={ch.followers} delta={ch.followersDelta} />
|
||||
<MetricCell label="조회수" value={ch.views} delta={ch.viewsDelta} />
|
||||
<MetricCell label="참여율" value={ch.engagement} delta={ch.engagementDelta} />
|
||||
</div>
|
||||
</motion.div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* Top Content */}
|
||||
<h3 className="font-serif font-bold text-xl text-[#0A1128] mb-4">인기 콘텐츠 TOP 5</h3>
|
||||
<div className="bg-white rounded-2xl border border-slate-100 shadow-[3px_4px_12px_rgba(0,0,0,0.06)] overflow-hidden mb-10">
|
||||
<div className="grid grid-cols-[1fr_100px_80px_80px_60px_70px_70px] gap-2 px-5 py-3 bg-[#0A1128] text-white text-xs font-medium">
|
||||
<span>콘텐츠</span>
|
||||
<span>채널</span>
|
||||
<span className="text-right">조회수</span>
|
||||
<span className="text-right">좋아요</span>
|
||||
<span className="text-right">댓글</span>
|
||||
<span className="text-right">CTR</span>
|
||||
<span className="text-right">게시일</span>
|
||||
</div>
|
||||
{TOP_CONTENT.map((content, i) => {
|
||||
const TypeIcon = typeIcons[content.type] ?? FileTextFilled;
|
||||
const colors = typeColors[content.type] ?? typeColors.blog;
|
||||
return (
|
||||
<motion.div
|
||||
key={content.id}
|
||||
className={`grid grid-cols-[1fr_100px_80px_80px_60px_70px_70px] gap-2 px-5 py-4 items-center ${
|
||||
i % 2 === 0 ? 'bg-white' : 'bg-slate-50/50'
|
||||
} border-b border-slate-50 last:border-0`}
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
transition={{ duration: 0.3, delay: i * 0.08 }}
|
||||
>
|
||||
<div className="flex items-center gap-2 min-w-0">
|
||||
<div className={`w-7 h-7 rounded-lg flex items-center justify-center shrink-0 ${colors.bg}`}>
|
||||
<TypeIcon size={14} className={colors.text} />
|
||||
</div>
|
||||
<span className="text-sm text-[#0A1128] truncate">{content.title}</span>
|
||||
</div>
|
||||
<span className="text-xs text-slate-500">{content.channel}</span>
|
||||
<span className="text-sm font-medium text-[#0A1128] text-right">{content.views}</span>
|
||||
<span className="text-sm text-slate-600 text-right">{content.likes}</span>
|
||||
<span className="text-sm text-slate-600 text-right">{content.comments}</span>
|
||||
<span className={`text-sm font-medium text-right ${
|
||||
parseFloat(content.ctr) >= 10 ? 'text-[#4A3A7C]' : 'text-slate-600'
|
||||
}`}>{content.ctr}</span>
|
||||
<span className="text-xs text-slate-400 text-right">{content.publishedAt}</span>
|
||||
</motion.div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* AI Recommendations */}
|
||||
<div className="bg-gradient-to-r from-[#fff3eb] via-[#e4cfff] to-[#f5f9ff] rounded-2xl p-8">
|
||||
<h3 className="font-serif font-bold text-xl text-[#021341] mb-4">AI 개선 추천</h3>
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
{[
|
||||
{ title: 'YouTube Shorts 확대', desc: 'Shorts 조회수가 Long-form 대비 3.2배 높습니다. 주 3회 이상 Shorts 업로드를 권장합니다.' },
|
||||
{ title: 'Instagram Reels 시작', desc: 'KR 계정에 Reels 0개입니다. 경쟁 병원 평균 주 5개 — 즉시 시작이 필요합니다.' },
|
||||
{ title: '랜딩 페이지 최적화', desc: '클릭→유입 전환율 13.9%로 업계 평균 20% 대비 낮음. CTA 버튼 위치와 페이지 속도 개선 필요.' },
|
||||
].map((rec, i) => (
|
||||
<div key={i} className="bg-white/70 backdrop-blur-sm rounded-xl border border-white/40 p-5">
|
||||
<h4 className="font-semibold text-[#021341] mb-2">{rec.title}</h4>
|
||||
<p className="text-sm text-[#021341]/60">{rec.desc}</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function MetricCell({ label, value, delta }: { label: string; value: string; delta: string }) {
|
||||
const isPositive = delta.startsWith('+');
|
||||
const isNew = delta === 'NEW' || delta === '-';
|
||||
return (
|
||||
<div className="text-center">
|
||||
<p className="text-xs text-slate-400 mb-1">{label}</p>
|
||||
<p className="text-sm font-semibold text-[#0A1128]">{value}</p>
|
||||
<p className={`text-xs font-medium ${
|
||||
isNew ? 'text-slate-400' : isPositive ? 'text-[#4A3A7C]' : 'text-[#7C3A4B]'
|
||||
}`}>{delta}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
import { useParams } from 'react-router';
|
||||
import { useReport } from '../hooks/useReport';
|
||||
import { ReportNav } from '../components/report/ReportNav';
|
||||
import { ScreenshotProvider } from '../contexts/ScreenshotContext';
|
||||
|
||||
// Report section components
|
||||
import ReportHeader from '../components/report/ReportHeader';
|
||||
import ClinicSnapshot from '../components/report/ClinicSnapshot';
|
||||
import ChannelOverview from '../components/report/ChannelOverview';
|
||||
import YouTubeAudit from '../components/report/YouTubeAudit';
|
||||
import InstagramAudit from '../components/report/InstagramAudit';
|
||||
import FacebookAudit from '../components/report/FacebookAudit';
|
||||
import OtherChannels from '../components/report/OtherChannels';
|
||||
import ProblemDiagnosis from '../components/report/ProblemDiagnosis';
|
||||
import TransformationProposal from '../components/report/TransformationProposal';
|
||||
import RoadmapTimeline from '../components/report/RoadmapTimeline';
|
||||
import KPIDashboard from '../components/report/KPIDashboard';
|
||||
|
||||
const REPORT_SECTIONS = [
|
||||
{ id: 'header', label: '개요' },
|
||||
{ id: 'clinic-snapshot', label: '의원 현황' },
|
||||
{ id: 'channel-overview', label: '채널 종합' },
|
||||
{ id: 'youtube-audit', label: 'YouTube' },
|
||||
{ id: 'instagram-audit', label: 'Instagram' },
|
||||
{ id: 'facebook-audit', label: 'Facebook' },
|
||||
{ id: 'other-channels', label: '기타 채널' },
|
||||
{ id: 'problem-diagnosis', label: '문제 진단' },
|
||||
{ id: 'transformation', label: '변환 전략' },
|
||||
{ id: 'roadmap', label: '로드맵' },
|
||||
{ id: 'kpi-dashboard', label: 'KPI' },
|
||||
];
|
||||
|
||||
export default function ReportPage() {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const { data, isLoading, error } = useReport(id);
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center pt-20">
|
||||
<div className="flex flex-col items-center gap-4">
|
||||
<div className="w-10 h-10 border-4 border-[#6C5CE7] border-t-transparent rounded-full animate-spin" />
|
||||
<p className="text-slate-500 text-sm">리포트를 불러오는 중...</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (error || !data) {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center pt-20">
|
||||
<div className="text-center">
|
||||
<p className="text-[#7C3A4B] font-medium mb-2">오류가 발생했습니다</p>
|
||||
<p className="text-slate-500 text-sm">{error ?? '리포트를 찾을 수 없습니다.'}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<ScreenshotProvider screenshots={data.screenshots ?? []}>
|
||||
<div className="pt-20">
|
||||
<ReportNav sections={REPORT_SECTIONS} />
|
||||
|
||||
<div data-report-content>
|
||||
<ReportHeader
|
||||
overallScore={data.overallScore}
|
||||
clinicName={data.clinicSnapshot.name}
|
||||
clinicNameEn={data.clinicSnapshot.nameEn}
|
||||
targetUrl={data.targetUrl}
|
||||
date={data.createdAt}
|
||||
location={data.clinicSnapshot.location}
|
||||
logoImage={data.clinicSnapshot.logoImages?.horizontal}
|
||||
brandColors={data.clinicSnapshot.brandColors}
|
||||
/>
|
||||
|
||||
<ClinicSnapshot data={data.clinicSnapshot} />
|
||||
|
||||
<ChannelOverview channels={data.channelScores} />
|
||||
|
||||
<YouTubeAudit data={data.youtubeAudit} />
|
||||
|
||||
<InstagramAudit data={data.instagramAudit} />
|
||||
|
||||
<FacebookAudit data={data.facebookAudit} />
|
||||
|
||||
<OtherChannels
|
||||
channels={data.otherChannels}
|
||||
website={data.websiteAudit}
|
||||
/>
|
||||
|
||||
<ProblemDiagnosis diagnosis={data.problemDiagnosis} />
|
||||
|
||||
<TransformationProposal data={data.transformation} />
|
||||
|
||||
<RoadmapTimeline months={data.roadmap} />
|
||||
|
||||
<KPIDashboard metrics={data.kpiDashboard} />
|
||||
</div>
|
||||
</div>
|
||||
</ScreenshotProvider>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user