lms/public/build/assets/table-footer-B-sB7gNG.js
2025-12-15 12:26:23 +01:00

2 lines
2.6 KiB
JavaScript

import{u as I,j as e,e as g}from"./vendor-BKmmeuxg.js";import{D as b,a as j,b as N,c as v}from"./dropdown-menu-DO-po5c1.js";import{u as T}from"./use-lang-YfV87_zl.js";import{g as f}from"./route-B4ZMN77y.js";import{B as a}from"./button-BpNwv2aE.js";import{S as _}from"./scroll-area-C8HGru-R.js";const E=y=>{const{routeName:m,routeParams:x,className:k,paginationInfo:w}=y,{table:d,common:r}=T(),{current_page:o,last_page:n,first_page_url:C,last_page_url:P,next_page_url:c,prev_page_url:i}=w,D=I(),p=f(D.url),t=[];if(n>0)for(let s=1;s<=n;s++)t.push({key:`${s}`,value:s});else t.push({key:"1",value:1});const u=s=>{g.get(route(m,{...x||{},...p,page:s}))},l=s=>{const M=f(s);g.get(route(m,{...x||{},...p,...M}))},h=s=>`text-center py-1 ${o===s&&"bg-primary-50"}`;return e.jsxs("div",{className:`${k}`,children:[e.jsxs("div",{className:"mb-4 flex items-center justify-center md:hidden",children:[e.jsx("span",{className:"mr-1",children:e.jsxs("strong",{children:[o," ",r.of," ",n]})}),e.jsxs("span",{className:"mr-3",children:["| ",d.go_to_page]}),e.jsxs(b,{children:[e.jsx(j,{children:e.jsx(a,{variant:"secondary",className:"hover:border-primary h-8 w-[60px] rounded-md border border-gray-200 text-gray-700",children:o})}),e.jsx(N,{align:"end",className:"min-w-[60px]",children:e.jsx(_,{className:"",children:t.map(s=>e.jsx(v,{onClick:()=>u(s.value),className:h(s.value),children:s.value},s.key))})})]})]}),e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(a,{variant:"ghost",disabled:!i,onClick:()=>l(C),className:"bg-muted border-border h-8 border px-2 text-xs sm:px-3",children:r.first}),e.jsx(a,{variant:"ghost",disabled:!i,onClick:()=>l(i),className:"bg-muted border-border mx-3 h-8 border px-2 text-xs sm:px-3",children:d.previous}),e.jsxs("div",{className:"hidden items-center md:flex",children:[e.jsxs("span",{className:"mr-1",children:[r.page," ",e.jsxs("strong",{children:[o," ",r.of," ",n]})]}),e.jsxs("span",{className:"mr-3",children:["| ",d.go_to_page]}),e.jsxs(b,{children:[e.jsx(j,{children:e.jsx(a,{variant:"ghost",className:"border-border h-8 w-[60px] rounded-md border",children:o})}),e.jsx(N,{align:"end",className:"min-w-[60px]",children:e.jsx(_,{className:"",children:t.map(s=>e.jsx(v,{onClick:()=>u(s.value),className:h(s.value),children:s.value},s.key))})})]})]}),e.jsx(a,{variant:"ghost",disabled:!c,onClick:()=>l(c),className:"bg-muted border-border mx-3 h-8 border px-2 text-xs sm:px-3",children:r.next}),e.jsx(a,{variant:"ghost",disabled:!c,onClick:()=>l(P),className:"bg-muted border-border h-8 border px-2 text-xs sm:px-3",children:r.last})]})]})};export{E as T};