import { BrowserRouter, Link, Route, Routes } from 'react-router'; import { useMsal } from '@azure/msal-react'; import DevAuthSwitcher from './components/DevAuthSwitcher'; import { DEFAULT_COMMUNITY_ID } from './config'; import { useCommunity } from './api/hooks'; import { isMsalConfigured } from './lib/auth/msal.config'; import AuthCallbackPage from './pages/AuthCallback'; import HomePage from './pages/HomePage'; import LoginPage from './pages/Login'; import MatchDetailPage from './pages/MatchDetailPage'; import MatchTeamProgressPage from './pages/MatchTeamProgressPage'; import AuctionPage from './pages/AuctionPage'; import UserHistoryPage from './pages/UserHistoryPage'; import CommunityInternalStatsPage from './pages/CommunityInternalStatsPage'; import InternalMatchDetailPage from './pages/InternalMatchDetailPage'; import LegacyImportPage from './pages/admin/LegacyImportPage'; import LegacyMatchesPage from './pages/admin/LegacyMatchesPage'; import MatchAdminPage from './pages/admin/MatchAdminPage'; import TournamentCodesPage from './pages/admin/TournamentCodesPage'; function MsalHeaderActions() { const { accounts, instance } = useMsal(); const account = instance.getActiveAccount() ?? accounts[0]; if (!account) { return ( 로그인 ); } return ( void instance.logoutRedirect()} > {account.name ?? account.username} 로그아웃 ); } function App() { const communityQuery = useCommunity(DEFAULT_COMMUNITY_ID); const communityLabel = communityQuery.data?.name ?? 'LOLYMPUS'; return ( {communityLabel} {DEFAULT_COMMUNITY_ID ? ( API Live ) : ( Set `VITE_DEFAULT_COMMUNITY_ID` )} {isMsalConfigured && } } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> ); } export default App;