import { useParams, Link } from 'react-router-dom';
import { useQuery, keepPreviousData } from '@tanstack/react-query';
import { motion } from 'framer-motion';
import { Calendar, ChevronRight } from 'lucide-react';
import { getSchedule } from '@/api';
// 섹션 컴포넌트들
import { YoutubeSection, XSection, DefaultSection, decodeHtmlEntities } from './sections';
import Birthday from './Birthday';
/**
* 특수 일정 ID 파싱
* @param {string} id - 일정 ID
* @returns {object|null} { type, year, nameEn } 또는 null
*/
function parseSpecialId(id) {
// birthday-{year}-{nameEn} 형식
const birthdayMatch = id.match(/^birthday-(\d{4})-(.+)$/);
if (birthdayMatch) {
return { type: 'birthday', year: birthdayMatch[1], nameEn: birthdayMatch[2] };
}
// debut-{year} 형식
const debutMatch = id.match(/^debut-(\d{4})$/);
if (debutMatch) {
return { type: 'debut', year: debutMatch[1] };
}
// anniversary-{year} 형식
const anniversaryMatch = id.match(/^anniversary-(\d{4})$/);
if (anniversaryMatch) {
return { type: 'anniversary', year: anniversaryMatch[1] };
}
return null;
}
/**
* PC 일정 상세 페이지
*/
function PCScheduleDetail() {
const { id } = useParams();
// 특수 일정 ID 체크
const specialId = parseSpecialId(id);
if (specialId?.type === 'birthday') {
return
요청하신 일정이 존재하지 않거나 삭제되었을 수 있습니다.
다른 일정을 확인해 주세요.