<script setup lang="ts">
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
import Pagination from './pagination.vue'

const props = defineProps<{
  paginationMeta: PaginationMeta
}>()

const emit = defineEmits<{
  pageChange: [page: number]
}>()

function handlePageChange(page: number) {
  emit('pageChange', page)
}
</script>

<template>
  <Pagination
  v-if="props.paginationMeta && props.paginationMeta.pageSize > 0"
  :pagination-meta="paginationMeta"
  @page-change="handlePageChange"
  />
</template>
