<script setup>
import { SessionUser } from "@/components/session/token/SessionUser.vue";
import { ref } from 'vue';
import { useRouter } from "vue-router";
import XLVaskUsageLog from "@/views/dashboards/superUserDashboard/vehicle/displays/XLVaskUsageLog.vue";

const router = useRouter();
// Get the registration from the route
const reg = ref(router.currentRoute.value.params.reg);
const dateFrom = ref(router.currentRoute.value.query.dateFrom);

const parsedDateFrom = ref(null);
if (dateFrom.value !== undefined && dateFrom.value !== null) {
  parsedDateFrom.value = SessionUser.superUser.modules.xlvask.functions.convertISODateTimeToDate(dateFrom.value);
} else {
  parsedDateFrom.value = null;
}
</script>

<template>
  <XLVaskUsageLog v-bind:reg="reg" v-bind:dateFrom="parsedDateFrom" />
</template>

<style scoped>

</style>