import { render } from 'solid-js/web';
import { Router, Route } from '@solidjs/router';
import App from './App';
import LandingPage from './pages/LandingPage';
import AdsLandingPage from './pages/AdsLandingPage';
import BlogPage from './pages/BlogPage';
import BlogPostPage from './pages/BlogPostPage';
import './index.css';

const root = document.getElementById('root');
if (!root) throw new Error('Root element not found');

render(() => (
  <Router root={App}>
    <Route path="/" component={LandingPage} />
    <Route path="/ads" component={AdsLandingPage} />
    <Route path="/blog" component={BlogPage} />
    <Route path="/blog/:slug" component={BlogPostPage} />
  </Router>
), root);
