mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
feat: driver train view
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<section class="driver-view">
|
||||
<div class="content">
|
||||
<div v-if="chosenTrain">
|
||||
<TrainInfo :train="chosenTrain" :extended="true" ref="trainInfo" />
|
||||
<TrainSchedule :train="chosenTrain" tabindex="0" />
|
||||
</div>
|
||||
|
||||
<Loading v-else-if="apiStore.dataStatuses.connection == Status.Data.Loading" />
|
||||
|
||||
<div v-else>Ups! Nie ma takiego pociągu</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import TrainInfo from '../components/TrainsView/TrainInfo.vue';
|
||||
import TrainSchedule from '../components/TrainsView/TrainSchedule.vue';
|
||||
import Loading from '../components/Global/Loading.vue';
|
||||
import { useMainStore } from '../store/mainStore';
|
||||
import { useApiStore } from '../store/apiStore';
|
||||
import { Status } from '../typings/common';
|
||||
|
||||
const props = defineProps({
|
||||
trainId: {
|
||||
required: true
|
||||
}
|
||||
});
|
||||
|
||||
const mainStore = useMainStore();
|
||||
const apiStore = useApiStore();
|
||||
const chosenTrain = computed(() => mainStore.trainList.find((train) => train.id == props.trainId));
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '../styles/variables.scss';
|
||||
|
||||
.driver-view {
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
background-color: #1a1a1a;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user