import { createRouter, createWebHashHistory } from "vue-router";

import HomeView from '../views/home/Home.vue';
import AboutView from '../views/about/About.vue';
import ProductsView from '../views/products/Products.vue';
import SocialView from '../views/social/Social.vue';
import ContactView from '../views/contact/Contact.vue';
import ImpressumView from '../views/impressum/Impressum.vue';
import DataProtectionView from '../views/dataprotection/DataProtection.vue';
import AgbView from '../views/agb/Agb.vue';
import StoreView from '../views/store/StoreView.vue';
import Gewinnspielbedingungen from '../views/gewinnspielbedingungen/Gewinnspielbedingungen.vue';
import Widerrufsrecht from '../views/widerrufsrecht/Widerrufsrecht.vue';

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/about',
      name: 'about',
      component: AboutView,
    },
    {
      path: '/products',
      name: 'products',
      component: ProductsView,
    },
    {
      path: '/social',
      name: 'social',
      component: SocialView,
    },
    {
      path: '/contact',
      name: 'contact',
      component: ContactView,
    },
    {
      path: '/impressum',
      name: 'impressum',
      component: ImpressumView,
    },
    {
      path: '/dataprotection',
      name: 'dataprotection',
      component: DataProtectionView,
    },
    {
      path: '/agb',
      name: 'agb',
      component: AgbView,
    },
    { 
      path: '/store',
      name: 'store',
      component: StoreView,
    },
    { 
      path: '/gewinnspielbedingungen',
      name: 'gewinnspielbedingungen',
      component: Gewinnspielbedingungen,
    },
    { 
      path: '/widerrufsrecht',
      name: 'widerrufsrecht',
      component: Widerrufsrecht,
    },
  ],
  scrollBehavior(to, from, savedPosition) {
    // always scroll to top
    return { top: 0 }
  },
});

export default router;