import { motion } from 'framer-motion';
import { Calendar, Link2, Clock } from 'lucide-react';
import { decodeHtmlEntities, formatXDateTimeWithTime } from './utils';
/**
* 영상 정보 컴포넌트 (공통)
*/
function VideoInfo({ schedule, isShorts, isScheduled = false }) {
const members = schedule.members || [];
const isFullGroup = members.length === 5;
// 채널명: channelName 또는 source.name에서 가져옴
const channelName = schedule.channelName || schedule.source?.name;
return (
{/* 제목 */}
{decodeHtmlEntities(schedule.title)}
{isScheduled && (
예정
)}
{/* 메타 정보 */}
{/* 날짜/시간 */}
{formatXDateTimeWithTime(schedule.date, schedule.time)}
{/* 채널명 */}
{channelName && (
<>
{channelName}
>
)}
{/* 멤버 목록 */}
{members.length > 0 && (
{isFullGroup ? (
프로미스나인
) : (
members.map((member) => (
{member.name}
))
)}
)}
{/* 유튜브에서 보기 버튼 (예정 일정이 아닐 때만) */}
{!isScheduled && (
)}
);
}
/**
* 예정 일정 Placeholder 컴포넌트
*/
function ScheduledPlaceholder({ bannerUrl }) {
return (
{/* 배경: 배너 이미지 또는 패턴 */}
{bannerUrl ? (
) : (
)}
{/* 하단 텍스트 */}
);
}
/**
* PC 유튜브 섹션 컴포넌트
*/
function YoutubeSection({ schedule }) {
const videoId = schedule.videoId;
const isShorts = schedule.videoType === 'shorts';
const isScheduled = !videoId; // videoId가 없으면 예정 일정
// 예정 일정: 세로 레이아웃 (Placeholder + 정보)
if (isScheduled) {
return (
{/* 예정 Placeholder */}
{/* 영상 정보 카드 */}
);
}
// 숏츠: 가로 레이아웃 (영상 + 정보)
if (isShorts) {
return (
{/* 영상 임베드 */}
{/* 영상 정보 카드 */}
);
}
// 일반 영상: 세로 레이아웃 (영상 위, 정보 아래)
return (
{/* 영상 임베드 */}
{/* 영상 정보 카드 */}
);
}
export default YoutubeSection;