53 lines
1.7 KiB
Vue
53 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";
|
|
|
|
useAppStore().setPageTitle("Zajímavá místa");
|
|
|
|
|
|
const {filters, loadPage, paginationLimit, paginationOffset} = usePagination({
|
|
fetchFunction: usePointsOfInterestStore().fetch,
|
|
itemsPerPage: 1 // nefunguje
|
|
});
|
|
loadPage(false);
|
|
const handleFiltersChanged = (newFilters) => {
|
|
paginationOffset.value = 0;
|
|
filters.value = newFilters;
|
|
loadPage(false);
|
|
}
|
|
|
|
const {isQueryRunning, totalItemsCount, pointsOfInterest} = storeToRefs(usePointsOfInterestStore());
|
|
</script>
|
|
|
|
<template>
|
|
<ListFilters @filters-changed="handleFiltersChanged"/>
|
|
|
|
<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"
|
|
:total-items-count="totalItemsCount"
|
|
:is-query-running="isQueryRunning"
|
|
:items-per-page="paginationLimit"
|
|
@load-more="loadPage(true)"
|
|
/>
|
|
<FAB :router-link="{name: 'addPOI'}" mode="add"/>
|
|
</template>
|