@accounter/client
Version:
2 lines (1 loc) • 2.01 kB
JavaScript
import{v as t,j as e,ao as i,ap as c,aq as o,ar as l,as as r,B as n,gX as x,gh as d}from"./index-DRqooPz9.js";const g=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],h=t("chevrons-left",g);const p=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],m=t("chevrons-right",p);function u({table:s}){return e.jsxs("div",{className:"flex items-center space-x-6 lg:space-x-8",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"Rows per page"}),e.jsxs(i,{value:String(s.getState().pagination.pageSize),onValueChange:a=>{s.setPageSize(Number(a))},children:[e.jsx(c,{className:"h-8 w-[70px]",children:e.jsx(o,{placeholder:s.getState().pagination.pageSize})}),e.jsx(l,{side:"top",children:[10,20,30,40,50,100].map(a=>e.jsx(r,{value:String(a),children:a},a))})]})]}),e.jsxs("div",{className:"flex w-[100px] items-center justify-center text-sm font-medium",children:["Page ",s.getState().pagination.pageIndex+1," of ",s.getPageCount()]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs(n,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>s.setPageIndex(0),disabled:!s.getCanPreviousPage(),children:[e.jsx("span",{className:"sr-only",children:"Go to first page"}),e.jsx(h,{})]}),e.jsxs(n,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>s.previousPage(),disabled:!s.getCanPreviousPage(),children:[e.jsx("span",{className:"sr-only",children:"Go to previous page"}),e.jsx(x,{})]}),e.jsxs(n,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>s.nextPage(),disabled:!s.getCanNextPage(),children:[e.jsx("span",{className:"sr-only",children:"Go to next page"}),e.jsx(d,{})]}),e.jsxs(n,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>s.setPageIndex(s.getPageCount()-1),disabled:!s.getCanNextPage(),children:[e.jsx("span",{className:"sr-only",children:"Go to last page"}),e.jsx(m,{})]})]})]})}export{u as D};