// ASA Timmerwerken v2 — App

function App() {
  const [page, setPage] = React.useState('home');

  const navigate = (p) => {
    setPage(p);
    window.scrollTo({ top: 0, behavior: 'instant' });
  };

  const pages = {
    home:         <HomePage navigate={navigate} />,
    over:         <OverOnsPage navigate={navigate} />,
    diensten:     <DienstenPage navigate={navigate} />,
    'dienst-detail': <DienstDetailPage navigate={navigate} />,
    calculator:   <CalculatorPage navigate={navigate} />,
    contact:      <ContactPage navigate={navigate} />,
  };

  return (
    <div style={{ minHeight: '100vh' }}>
      <Nav currentPage={page} navigate={navigate} />
      <main>{pages[page] || pages.home}</main>
      <Footer navigate={navigate} />
    </div>
  );
}

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<App />);
