import { Routes, Route, Navigate } from 'react-router-dom';
import { useAuthStore } from '@/stores';
// 관리자 페이지
import AdminLogin from '@/pages/pc/admin/login/Login';
/**
* 인증 필수 라우트 가드
* token이 없으면 로그인 페이지로 즉시 리다이렉트
*/
function RequireAuth({ children }) {
const { token, _hasHydrated } = useAuthStore();
// Hydration 완료 전에는 아무것도 렌더링하지 않음
if (!_hasHydrated) {
return null;
}
if (!token) {
return ;
}
return children;
}
import AdminDashboard from '@/pages/pc/admin/dashboard/Dashboard';
import AdminMembers from '@/pages/pc/admin/members/Members';
import AdminMemberEdit from '@/pages/pc/admin/members/MemberEdit';
import AdminAlbums from '@/pages/pc/admin/albums/Albums';
import AdminAlbumForm from '@/pages/pc/admin/albums/AlbumForm';
import AdminAlbumPhotos from '@/pages/pc/admin/albums/AlbumPhotos';
import AdminSchedules from '@/pages/pc/admin/schedules/Schedules';
import AdminScheduleForm from '@/pages/pc/admin/schedules/ScheduleForm';
import AdminScheduleFormPage from '@/pages/pc/admin/schedules/form';
import AdminYouTubeEditForm from '@/pages/pc/admin/schedules/edit/YouTubeEditForm';
import AdminConcertEditForm from '@/pages/pc/admin/schedules/edit/ConcertEditForm';
import AdminScheduleCategory from '@/pages/pc/admin/schedules/ScheduleCategory';
import AdminScheduleDict from '@/pages/pc/admin/schedules/ScheduleDict';
import AdminScheduleBots from '@/pages/pc/admin/schedules/ScheduleBots';
import AdminLogs from '@/pages/pc/admin/logs/Logs';
import AdminNotFound from '@/pages/pc/admin/common/NotFound';
/**
* PC 관리자 라우트
*/
export default function AdminRoutes() {
return (
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
);
}