50 lines
1.7 KiB
Vue
50 lines
1.7 KiB
Vue
<script setup>
|
|
import {useAppStore} from "stores/App";
|
|
import POIList from "components/poi/POIList.vue";
|
|
import FAB from "components/FAB.vue";
|
|
import BasicListSkeleton from "components/basicSkeletons/BasicListSkeleton.vue";
|
|
import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
|
|
import {usePointsOfInterestStore} from "stores/PointsOfInterest";
|
|
import {storeToRefs} from "pinia";
|
|
import {usePagination} from "src/composables/pagination";
|
|
import ListFilters from "components/ListFilters.vue";
|
|
import {onMounted} from "vue";
|
|
import PrimaryAction from "components/PrimaryAction.vue";
|
|
|
|
useAppStore().setPageTitle("Zajímavá místa");
|
|
useAppStore().setBreadcrumbs([]);
|
|
|
|
const {loadPage, hasMoreData, handleFiltersChanged} = usePagination({
|
|
fetchFunction: usePointsOfInterestStore().fetch,
|
|
itemsPerPage: 20
|
|
});
|
|
|
|
const {isQueryRunning, pointsOfInterest} = storeToRefs(usePointsOfInterestStore());
|
|
</script>
|
|
|
|
<template>
|
|
<ListFilters @filters-changed="handleFiltersChanged">
|
|
<template #append>
|
|
<PrimaryAction mode="add" :router-link="{name: 'addPOI'}"/>
|
|
</template>
|
|
</ListFilters>
|
|
|
|
<BasicListSkeleton :items="10" v-if="isQueryRunning && !pointsOfInterest.length"/>
|
|
<BasicInfoBanner
|
|
v-else-if="!isQueryRunning && pointsOfInterest.length === 0"
|
|
:route-add="{name: 'addPoi'}"
|
|
label-add="Přidat"
|
|
>
|
|
Nemáš tu uložené žádné zajímavé místo. Přidej si let, nastav si tam ručně trasu a jednotlivé body se zobrazí
|
|
i v tomto seznamu.
|
|
</BasicInfoBanner>
|
|
|
|
<POIList
|
|
v-else
|
|
:public="false"
|
|
:items="pointsOfInterest"
|
|
:has-more-data="hasMoreData"
|
|
@load-more="loadPage($event.index, $event.done)"
|
|
/>
|
|
</template>
|