Files
app/src/pages/public/pilotProfile/CopilotDetailPage.vue
T

47 lines
1.2 KiB
Vue

<script>
import {useCopilotsStore} from "stores/Copilots";
export default {
preFetch({currentRoute}) {
return useCopilotsStore().fetchDetail(currentRoute.params.id, currentRoute.params.username);
}
}
</script>
<script setup>
import FlightsList from "components/flights/FlightsList.vue";
import {useAppStore} from "stores/App";
import BasicListSkeleton from "components/basicSkeletons/BasicListSkeleton.vue";
import {storeToRefs} from "pinia";
const props = defineProps({
pilot: {
type: Object,
required: false
},
});
const {copilot, isQueryRunning} = storeToRefs(useCopilotsStore());
useAppStore().setPageTitle(`${pilot.name} + ${copilot.value.name}`);
useAppStore().setBreadcrumbs([
{to: {name: 'homepage'}, label: "Polétání.cz"},
{to: {name: "publicProfileDetail", params: {username: props.username}}, label: `@${props.username}`},
{label: props.pilot.name}
]);
</script>
<template>
<BasicListSkeleton v-if="isQueryRunning || !copilot" class="q-mb-md"/>
<template v-else>
<h3>Společné lety</h3>
<FlightsList
:items="copilot.flights"
:route-detail="{name: 'publicFlightDetail', params: {username: pilot.publicUsername}}"
class="q-mb-md"
/>
</template>
</template>