import { BrowserRouter, Routes, Route, NavLink } from "react-router-dom"; import { cn, getTodayKST, formatFullDate } from "@/utils"; import { useUIStore } from "@/stores"; import { useIsMobile, useCategories, useScheduleData } from "@/hooks"; import { ErrorBoundary, Loading, ToastContainer, ScheduleCard, Layout } from "@/components"; import { Schedule, Album } from "@/pages"; /** * 홈 페이지 (임시) */ function Home() { const today = getTodayKST(); const isMobile = useIsMobile(); const { showSuccess, showError } = useUIStore(); const { data: categories, isLoading: categoriesLoading } = useCategories(); const currentDate = new Date(); const { data: schedules, isLoading: schedulesLoading } = useScheduleData( currentDate.getFullYear(), currentDate.getMonth() + 1 ); return (

fromis_9 Frontend Refactoring

Phase 7 진행 중 - 스케줄 페이지

디바이스: {isMobile ? "모바일" : "PC"}

오늘: {formatFullDate(today)}

카테고리 ({categories?.length || 0}개)

{categoriesLoading ? ( ) : (
{categories?.map((c) => ( {c.name} ))}
)}

토스트 테스트

페이지 이동

일정 페이지
{/* ScheduleCard 컴포넌트 테스트 */} {schedulesLoading ? (
) : schedules?.length > 0 ? ( <> {/* Public Variant (공개 페이지용) */}

variant="public" (공개 페이지용)

{schedules.slice(0, 2).map((schedule) => ( showSuccess(`${schedule.title} 클릭`)} /> ))}
{/* Admin Variant (관리자 페이지용) */}

variant="admin" (관리자 페이지용)

{schedules.slice(0, 2).map((schedule) => ( showSuccess(`${schedule.title} 클릭`)} onEdit={(s) => showSuccess(`${s.title} 수정`)} onDelete={(s) => showError(`${s.title} 삭제`)} /> ))}
) : (

이번 달 스케줄이 없습니다.

)}
); } /** * 프로미스나인 팬사이트 메인 앱 * * Phase 8: 앨범 페이지 마이그레이션 * - Album 페이지 (PC/Mobile 통합) * - useAlbums 훅 추가 */ function App() { return ( {/* 홈 */} } /> {/* 스케줄 */} } /> {/* 임시 페이지들 */}
멤버 페이지 (준비 중)
} /> {/* 앨범 */} } />
); } export default App;