import Register from './pages/Register';
import Login from './pages/Login';
import Dashboard from './components/Dashboard';
import Profile from './pages/Profile';
import Product from './pages/Product';
import Warehouse from './pages/Warehouse';
import Sales from './pages/Sales';
import Reports from './pages/Reports';
import ProtectedRoute from './components/ProtectedRoute';

import { BrowserRouter, Routes, Route } from 'react-router-dom';

function App() {
  return (
    <div>
      <BrowserRouter>
        <Routes>
          <Route path='/' element={
            <ProtectedRoute>
              <Dashboard />
            </ProtectedRoute>
          } />
          <Route path='/dashboard' element={
            <ProtectedRoute>
              <Dashboard />
            </ProtectedRoute>
          } />
          <Route path='/login' element={<Login />} />
          <Route path='/register' element={<Register />} />
          <Route path='/dashboard/products' element={
            <ProtectedRoute>
              <Product />
            </ProtectedRoute>
          } />
          <Route path='/dashboard/warehouse' element={
            <ProtectedRoute>
              <Warehouse />
            </ProtectedRoute>
          } />
          <Route path='/dashboard/transactions' element={
            <ProtectedRoute>
              <Sales />
            </ProtectedRoute>
          } />
          <Route path='/dashboard/reports' element={
            <ProtectedRoute>
              <Reports />
            </ProtectedRoute>
          } />
          <Route path='/dashboard/profile' element={
            <ProtectedRoute>
              <Profile />
            </ProtectedRoute>
          } />
        </Routes>
      </BrowserRouter>
    </div>
  );
}

export default App;
