import { BrowserRouter, Routes, Route } from "react-router-dom";
import { ErrorBoundary, ToastContainer, Layout } from "@/components";
import { Schedule, Album, Home, Members, NotFound } from "@/pages";

/**
 * 프로미스나인 팬사이트 메인 앱
 *
 * Phase 9: 기타 공개 페이지 마이그레이션
 * - Home 페이지 (PC/Mobile 통합)
 * - Members 페이지 (PC/Mobile 통합)
 * - NotFound 페이지
 */
function App() {
  return (
    <BrowserRouter>
      <ErrorBoundary>
        <Routes>
          {/* 홈 */}
          <Route
            path="/"
            element={
              <Layout>
                <Home />
                <ToastContainer />
              </Layout>
            }
          />

          {/* 멤버 */}
          <Route
            path="/members"
            element={
              <Layout pageTitle="멤버">
                <Members />
                <ToastContainer />
              </Layout>
            }
          />

          {/* 앨범 */}
          <Route
            path="/album"
            element={
              <Layout pageTitle="앨범">
                <Album />
                <ToastContainer />
              </Layout>
            }
          />

          {/* 스케줄 */}
          <Route
            path="/schedule"
            element={
              <Layout useCustomLayout>
                <Schedule />
                <ToastContainer />
              </Layout>
            }
          />

          {/* 404 */}
          <Route
            path="*"
            element={
              <Layout>
                <NotFound />
              </Layout>
            }
          />
        </Routes>
      </ErrorBoundary>
    </BrowserRouter>
  );
}

export default App;
