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 Stock from './pages/Stock';
import Reports from './pages/Reports';
import ProtectedRoute from './components/ProtectedRoute';

import { BrowserRouter, Routes, Route } from 'react-router-dom';
import Supplier from './pages/Supplier';


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/spareparts'
            element={
              <ProtectedRoute>
                <Product />
              </ProtectedRoute>
            }
          />
          <Route
            path='/dashboard/profile'
            element={
              <ProtectedRoute>
                <Profile />
              </ProtectedRoute>
            }
          />
          <Route
            path='/dashboard/stock'
            element={
              <ProtectedRoute>
                <Stock />
              </ProtectedRoute>
            }
          />
          <Route
            path='/dashboard/suppliers'
            element={
              <ProtectedRoute>
                <Supplier />
              </ProtectedRoute>
            }
          />
          <Route
            path='/dashboard/reports'
            element={
              <ProtectedRoute>
                <Reports />
              </ProtectedRoute>
            }
          />
        </Routes>
      </BrowserRouter>
    </div>
  );
}

export default App
