import { Routes, Route, Link } from 'react-router-dom'
import Home from './pages/Home'
import PartDetail from './pages/PartDetail'
import PartFormPage from './pages/PartFormPage'

export default function App() {
  return (
    <>
      <nav className="nav">
        <Link to="/" className="nav-brand">⚙ Parts Inventory</Link>
      </nav>
      <Routes>
        <Route path="/" element={<Home />} />
        <Route path="/parts/new" element={<PartFormPage />} />
        <Route path="/parts/:id" element={<PartDetail />} />
        <Route path="/parts/:id/edit" element={<PartFormPage />} />
      </Routes>
    </>
  )
}
