import { useState } from 'react'; import { motion } from 'motion/react'; import { YoutubeFilled, InstagramFilled, FacebookFilled, GlobeFilled, TiktokFilled, VideoFilled, RefreshFilled, BoltFilled, } from '../icons/FilledIcons'; import { SectionWrapper } from '../report/ui/SectionWrapper'; import type { RepurposingProposalItem } from '../../types/plan'; interface RepurposingProposalProps { proposals: RepurposingProposalItem[]; } // Maps channel keyword → FilledIcon function ChannelIcon({ channel, size = 14 }: { channel: string; size?: number }) { const lower = channel.toLowerCase(); const className = 'shrink-0'; if (lower.includes('youtube')) return ; if (lower.includes('instagram')) return ; if (lower.includes('facebook')) return ; if (lower.includes('tiktok')) return ; if (lower.includes('naver') || lower.includes('blog')) return ; return ; } const effortConfig: Record = { low: { label: '빠른 작업', bg: 'bg-[#F3F0FF]', text: 'text-[#4A3A7C]', border: 'border-[#D5CDF5]' }, medium: { label: '중간 작업', bg: 'bg-[#FFF6ED]', text: 'text-[#7C5C3A]', border: 'border-[#F5E0C5]' }, high: { label: '집중 작업', bg: 'bg-[#FFF0F0]', text: 'text-[#7C3A4B]', border: 'border-[#F5D5DC]' }, }; const priorityConfig: Record = { high: { label: 'P0', dot: 'bg-[#D4889A]' }, medium: { label: 'P1', dot: 'bg-[#D4A872]' }, low: { label: 'P2', dot: 'bg-[#9B8AD4]' }, }; function formatViews(views: number): string { if (views >= 1_000_000) return `${(views / 1_000_000).toFixed(1)}M`; if (views >= 1_000) return `${Math.round(views / 1_000)}K`; return String(views); } export default function RepurposingProposal({ proposals }: RepurposingProposalProps) { const [expandedIdx, setExpandedIdx] = useState(0); return ( {proposals.map((item, idx) => { const effort = effortConfig[item.estimatedEffort]; const priority = priorityConfig[item.priority]; const isExpanded = expandedIdx === idx; return ( {/* Card Header — click to expand */} setExpandedIdx(isExpanded ? null : idx)} > {/* Source video info */} {item.sourceVideo.title} {formatViews(item.sourceVideo.views)} views {item.sourceVideo.type === 'Short' ? 'Shorts' : 'Long-form'} {/* Badges */} {/* Output count */} {item.outputs.length}개 포맷 {/* Effort */} {effort.label} {/* Priority */} {priority.label} {/* Chevron */} {/* Expanded: Repurpose outputs */} {isExpanded && ( REPURPOSE AS {item.outputs.map((output, oIdx) => ( {output.format} {output.channel} {output.description} ))} )} ); })} ); }
{item.sourceVideo.title}
REPURPOSE AS
{output.format}
{output.channel}
{output.description}