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

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

function App() {
  return (
    <BrowserRouter>
      <Routes>
        <Route path='/' element={<Login />} />
        <Route path='/login' element={<Login />} />
        <Route path='/register' element={<Register />} />
        
        <Route path='/dashboard' element={<ProtectedRoute><Dashboard /></ProtectedRoute>} />
        <Route path='/dashboard/products' element={<ProtectedRoute><Product /></ProtectedRoute>} />
        <Route path='/dashboard/profile' element={<ProtectedRoute><Profile /></ProtectedRoute>} />
        <Route path="/dashboard/sales" element={<ProtectedRoute><Sales /></ProtectedRoute>} />
        <Route path='/dashboard/supplier' element={<ProtectedRoute><Supplier /></ProtectedRoute>} />
      </Routes>
    </BrowserRouter>
  );
}

export default App;
