"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../../_virtual/jsx-runtime.js"),P=require("react"),c=require("../styles.js"),g=require("../constants.js"),m=require("../../Pagination/index.js"),n=require("../../../utils/index.js");const j=({footer:a,currentPage:i,setCurrentPage:u,numberOfRows:e,variant:l,"data-testid":o,"data-trackid":x})=>{var p,d;const s=n.getId(o),r=n.getId(x);return P.useEffect(()=>{a.variant==="pagination"&&a.pagination&&typeof a.pagination.onChangePage=="function"&&a.pagination.onChangePage(i)},[i]),a.variant==="pagination"?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[a.pagination&&a.pagination.displayResults&&t.jsxRuntimeExports.jsxs(c.ResultsArea,{"data-testid":s("results"),"data-trackid":r("results"),children:[((p=a.pagination.resultsText)==null?void 0:p.indicator)||g.defaultResultsText.indicator," ",i*a.pagination.rowsPerPage-a.pagination.rowsPerPage+1," ","- ",i*a.pagination.rowsPerPage," ",((d=a.pagination.resultsText)==null?void 0:d.preposition)||g.defaultResultsText.preposition," ",a.pagination.totalNumberOfItems||e]}),!a.pagination.externalPagination&&t.jsxRuntimeExports.jsx(m.Pagination,{variant:l,currentPage:i,rowsPerPage:a.pagination.rowsPerPage,totalItems:a.pagination.totalNumberOfItems||e,paginationLimiter:a.pagination.widePaginationLimiter,onChangePage:u,"data-testid":s(),"data-trackid":r()})]}):n.unitJSX};exports.default=j;
