import { useSSRContext, unref, mergeProps } from 'vue';
import { ssrRenderComponent } from 'vue/server-renderer';
import VPagination from '@hennge/vue3-pagination';
import { h as useRouter, g as useRoute } from './server.mjs';

const _sfc_main = {
  __name: "GeneralPagination",
  __ssrInlineRender: true,
  props: {
    pagination: {
      required: true
    }
  },
  setup(__props) {
    const router = useRouter();
    const route = useRoute();
    function fetchData(e) {
      console.log(e);
      router.push({
        query: Object.assign({}, route.query, {
          page: e
        })
      });
    }
    return (_ctx, _push, _parent, _attrs) => {
      _push(ssrRenderComponent(unref(VPagination), mergeProps({
        modelValue: __props.pagination.page,
        "onUpdate:modelValue": [($event) => __props.pagination.page = $event, fetchData],
        pages: __props.pagination.total,
        hideFirstButton: true,
        hideLastButton: true,
        "range-size": 1
      }, _attrs), null, _parent));
    };
  }
};
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/general/GeneralPagination.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

export { _sfc_main as _ };
//# sourceMappingURL=GeneralPagination-CkoRkEli.mjs.map
