30 lines
820 B
Vue
30 lines
820 B
Vue
<script>
|
|
import {usePilotsStore} from "stores/Pilots";
|
|
|
|
export default {
|
|
preFetch({store, currentRoute}) {
|
|
return usePilotsStore(store).fetchPublicPilotDetail(currentRoute.params.username).catch(e => {});
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<script setup>
|
|
import {storeToRefs} from "pinia";
|
|
import PilotProfileCard from "components/profile/PilotProfileCard.vue";
|
|
import PublicProfileSkeleton from "components/profile/skeletons/PublicProfileSkeleton.vue";
|
|
|
|
const {pilot, isQueryRunning: pilotLoading} = storeToRefs(usePilotsStore());
|
|
</script>
|
|
|
|
<template>
|
|
<div class="row">
|
|
<div class="col-12 col-md-8">
|
|
<router-view :pilot="pilot" />
|
|
</div>
|
|
<div class="col-12 col-md-4">
|
|
<PublicProfileSkeleton v-if="pilotLoading && !pilot"/>
|
|
<PilotProfileCard v-else :pilot="pilot"/>
|
|
</div>
|
|
</div>
|
|
</template>
|