import { createRouter, createWebHistory } from 'vue-router'

export default createRouter({
  history: createWebHistory(),
  routes: [
    { path: '/',            component: () => import('@/views/DashboardView.vue') },
    { path: '/jardins',     component: () => import('@/views/JardinsView.vue') },
    { path: '/jardins/:id', component: () => import('@/views/JardinDetailView.vue') },
    { path: '/plantes',     component: () => import('@/views/PlantesView.vue') },
    { path: '/bibliotheque', component: () => import('@/views/BibliothequeView.vue') },
    { path: '/outils',      component: () => import('@/views/OutilsView.vue') },
    { path: '/plantations', component: () => import('@/views/PlantationsView.vue') },
    { path: '/planning',    component: () => import('@/views/PlanningView.vue') },
    { path: '/taches',      component: () => import('@/views/TachesView.vue') },
    { path: '/calendrier',  component: () => import('@/views/CalendrierView.vue') },
    { path: '/reglages',    component: () => import('@/views/ReglagesView.vue') },
    // Redirect des anciens liens
    { path: '/varietes',    redirect: '/plantes' },
    { path: '/lunaire',     redirect: '/calendrier' },
  ],
})
