import { BrowserRouter, Routes, Route } from 'react-router-dom';
import { BrowserView, MobileView } from 'react-device-detect';

// PC 페이지
import PCHome from './pages/pc/Home';
import PCMembers from './pages/pc/Members';
import PCDiscography from './pages/pc/Discography';
import PCAlbumDetail from './pages/pc/AlbumDetail';
import PCAlbumGallery from './pages/pc/AlbumGallery';
import PCSchedule from './pages/pc/Schedule';

// 관리자 페이지
import AdminLogin from './pages/pc/admin/AdminLogin';
import AdminDashboard from './pages/pc/admin/AdminDashboard';
import AdminAlbums from './pages/pc/admin/AdminAlbums';

// PC 레이아웃
import PCLayout from './components/pc/Layout';

function App() {
    return (
        <BrowserRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
            <BrowserView>
                <Routes>
                    {/* 관리자 페이지 (레이아웃 없음) */}
                    <Route path="/admin" element={<AdminLogin />} />
                    <Route path="/admin/dashboard" element={<AdminDashboard />} />
                    <Route path="/admin/albums" element={<AdminAlbums />} />

                    {/* 일반 페이지 (레이아웃 포함) */}
                    <Route path="/*" element={
                        <PCLayout>
                            <Routes>
                                <Route path="/" element={<PCHome />} />
                                <Route path="/members" element={<PCMembers />} />
                                <Route path="/album" element={<PCDiscography />} />
                                <Route path="/album/:name" element={<PCAlbumDetail />} />
                                <Route path="/album/:name/gallery" element={<PCAlbumGallery />} />
                                <Route path="/schedule" element={<PCSchedule />} />
                            </Routes>
                        </PCLayout>
                    } />
                </Routes>
            </BrowserView>
            <MobileView>
                {/* 모바일 버전은 추후 구현 */}
                <div className="flex items-center justify-center h-screen bg-gray-100 p-4">
                    <div className="text-center">
                        <p className="text-xl font-bold text-primary mb-2">fromis_9</p>
                        <p className="text-gray-500">모바일 버전은 준비 중입니다.</p>
                    </div>
                </div>
            </MobileView>
        </BrowserRouter>
    );
}

export default App;
