Files
chatwoot/app/javascript/dashboard/components/widgets/TableFooter.vue
Muhsin Keloth 455a05481c fix: Remove background color from table footer (#9213)
* fix: remove bg from footer

* Update SLATable.vue

* Update app/javascript/dashboard/routes/dashboard/settings/reports/components/SLA/SLATable.vue

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2024-04-09 15:29:05 +10:00

49 lines
1.2 KiB
Vue

<template>
<footer
v-if="isFooterVisible"
class="h-12 flex items-center justify-between px-6"
>
<table-footer-results
:first-index="firstIndex"
:last-index="lastIndex"
:total-count="totalCount"
/>
<table-footer-pagination
v-if="totalCount"
:current-page="currentPage"
:total-pages="totalPages"
:total-count="totalCount"
:page-size="pageSize"
@page-change="$emit('page-change', $event)"
/>
</footer>
</template>
<script setup>
import { computed } from 'vue';
import TableFooterResults from './TableFooterResults.vue';
import TableFooterPagination from './TableFooterPagination.vue';
const props = defineProps({
currentPage: {
type: Number,
default: 1,
},
pageSize: {
type: Number,
default: 25,
},
totalCount: {
type: Number,
default: 0,
},
});
const totalPages = computed(() => Math.ceil(props.totalCount / props.pageSize));
const firstIndex = computed(() => props.pageSize * (props.currentPage - 1) + 1);
const lastIndex = computed(() =>
Math.min(props.totalCount, props.pageSize * props.currentPage)
);
const isFooterVisible = computed(
() => props.totalCount && !(firstIndex.value > props.totalCount)
);
</script>