import { BrowserRouter, Routes, Route } from "react-router-dom"; import { isMobile } from "react-device-detect"; import { cn, getTodayKST, formatFullDate } from "@/utils"; import { useAuthStore, useScheduleStore, useUIStore } from "@/stores"; /** * 프로미스나인 팬사이트 메인 앱 * * Phase 3: 스토어 완료 * - useAuthStore: 인증 상태 (localStorage 지속) * - useScheduleStore: 스케줄 페이지 상태 * - useUIStore: UI 상태 (모달, 토스트, 라이트박스 등) */ function App() { const today = getTodayKST(); const { isAuthenticated, login, logout } = useAuthStore(); const { viewMode, setViewMode, selectedCategories, toggleCategory } = useScheduleStore(); const { showSuccess, showError, toasts } = useUIStore(); const handleTestLogin = () => { login("test-token", { name: "테스트 유저" }); showSuccess("로그인 성공!"); }; const handleTestLogout = () => { logout(); showError("로그아웃됨"); }; return (

fromis_9 Frontend Refactoring

Phase 3 완료 - 스토어

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

오늘: {formatFullDate(today)}

useAuthStore 테스트

인증 상태: {isAuthenticated ? "✅ 로그인됨" : "❌ 로그아웃"}

useScheduleStore 테스트

뷰 모드: {viewMode}

선택된 카테고리: {selectedCategories.length > 0 ? selectedCategories.join(", ") : "없음"}

{[1, 2, 3].map((id) => ( ))}

useUIStore 토스트

활성 토스트: {toasts.length}개

{/* 토스트 표시 */}
{toasts.map((toast) => (
{toast.message}
))}
} />
); } export default App;