feat(ui): add right action bar and use it to start transaction
[e-mobility-charging-stations-simulator.git] / ui / web / src / router / index.ts
index b58a4d2a506d7e5f9c9f94a153bd1d7a7d0061ee..0d250c5101a48e6402934fad6a038f7c64dac78e 100644 (file)
@@ -1,17 +1,34 @@
-import { type RouteRecordRaw, createRouter, createWebHistory } from 'vue-router'
+import { createRouter, createWebHistory } from 'vue-router'
 import ChargingStationsView from '@/views/ChargingStationsView.vue'
+import StartTransaction from '@/components/actions/StartTransaction.vue'
+import AddChargingStations from '@/components/actions/AddChargingStations.vue'
 
-const routes: RouteRecordRaw[] = [
-  {
-    path: '/',
-    name: 'charging-stations',
-    component: ChargingStationsView,
-  },
-]
-
-const router = createRouter({
+export const router = createRouter({
   history: createWebHistory(),
-  routes,
+  routes: [
+    {
+      path: '/',
+      name: 'charging-stations',
+      components: {
+        default: ChargingStationsView
+      }
+    },
+    {
+      path: '/add-charging-stations',
+      name: 'add-charging-stations',
+      components: {
+        default: ChargingStationsView,
+        action: AddChargingStations
+      }
+    },
+    {
+      path: '/start-transaction/:hashId/:chargingStationId/:connectorId',
+      name: 'start-transaction',
+      components: {
+        default: ChargingStationsView,
+        action: StartTransaction
+      },
+      props: { default: false, action: true }
+    }
+  ]
 })
-
-export default router