import { RouterProvider } from 'react-router-dom';
import { router } from './router';


import { ThemeProvider, useAutoTokenRefresh } from './hooks';

/**
 * App Content Component
 * Wrapped by providers, uses hooks
 */
function AppContent() {
  // Enable automatic token refresh
  useAutoTokenRefresh();

  return <RouterProvider router={router} />;
}

/**
 * Main Application Component
 * Local-first accounting application
 */
function App() {
  return (
    <ThemeProvider>
      <AppContent />
    </ThemeProvider>
  );
}

export default App;
