52 lines
1.6 KiB
Vue
52 lines
1.6 KiB
Vue
<script setup>
|
|
import FlightsListSkeleton from "components/flights/skeletons/FlightsListSkeleton.vue";
|
|
import EventsList from "components/event/EventsList.vue";
|
|
import PublicFlightEventSwitcher from "components/navigation/PublicFlightEventSwitcher.vue";
|
|
import {useAppStore} from "stores/App";
|
|
import {useEventsStore} from "stores/Events";
|
|
import {storeToRefs} from "pinia";
|
|
import {useMeta} from "quasar";
|
|
import {commonKeywords, metaData} from "src/composables/meta";
|
|
|
|
const props = defineProps({
|
|
pilot: {
|
|
type: Object,
|
|
required: true
|
|
}
|
|
});
|
|
|
|
useMeta(() => metaData({
|
|
title: `${props.pilot.publicUsername} - Události`,
|
|
keywords: [...commonKeywords, "události", "letecký den",],
|
|
description: "Detail pilota na poletani.cz",
|
|
}));
|
|
|
|
useAppStore().setPageTitle(`${props.pilot.publicUsername}`);
|
|
useAppStore().setBreadcrumbs([
|
|
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
|
{to: {name: "publicProfileDetail", params: {username: props.pilot.publicUsername}}, label: `@${props.pilot.publicUsername}`},
|
|
{label: "Události"}
|
|
]);
|
|
|
|
useEventsStore().fetchPublic(props.pilot.publicUsername);
|
|
const {isQueryRunning, events} = storeToRefs(useEventsStore());
|
|
</script>
|
|
|
|
<template>
|
|
<PublicFlightEventSwitcher :username="pilot.publicUsername"/>
|
|
|
|
<div class="q-mb-md">
|
|
<FlightsListSkeleton v-if="isQueryRunning"/>
|
|
|
|
<q-banner class="bg-primary text-white" v-else-if="!isQueryRunning && events.length === 0">
|
|
Tento pilot zatím nepublikoval žádnou udalost.
|
|
</q-banner>
|
|
|
|
<EventsList
|
|
:items="events"
|
|
:route-detail="{name: 'publicEventDetail', params: {username: pilot.publicUsername}}"
|
|
v-else
|
|
/>
|
|
</div>
|
|
</template>
|