/**
 * Admin Frontend App Shell
 * 
 * 项目：用户管理系统 Admin 后台
 * 技术栈：React 18 + TypeScript + Vite + Ant Design 5
 */

import { Suspense } from 'react'
import { RouterProvider } from 'react-router-dom'
import { Spin } from 'antd'
import { ErrorBoundary } from '@/components/common'
import { router } from './router'

const routeFallback = (
  <div
    style={{
      height: '100vh',
      display: 'flex',
      alignItems: 'center',
      justifyContent: 'center',
      background: 'var(--color-canvas)',
    }}
  >
    <Spin size="large" />
  </div>
)

function App() {
  return (
    <ErrorBoundary>
      <Suspense fallback={routeFallback}>
        <RouterProvider router={router} />
      </Suspense>
    </ErrorBoundary>
  )
}

export default App
