import{j as e,D as d,m as o}from"./index-D4ZMoJFe.js";function b({page:x,pageSize:n=50,total:t,onPageChange:a,className:i=""}){const r=Math.max(Math.ceil(Number(t||0)/Number(n||1)),1),s=Math.min(Math.max(x||1,1),r),c=t?(s-1)*n+1:0,l=t?Math.min(s*n,t):0;return e.jsxs("div",{className:`flex flex-col gap-3 rounded-2xl border border-border bg-surface px-4 py-3 text-sm text-text sm:flex-row sm:items-center sm:justify-between ${i}`,children:[e.jsx("p",{className:"text-textMuted",children:t?e.jsxs(e.Fragment,{children:["Lignes ",e.jsx("span",{className:"font-semibold text-text",children:c})," à"," ",e.jsx("span",{className:"font-semibold text-text",children:l})," sur"," ",e.jsx("span",{className:"font-semibold text-text",children:t})]}):"Aucune ligne à paginer"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{type:"button",className:"btn-secondary inline-flex items-center gap-2 px-3 py-2",onClick:()=>a(s-1),disabled:s<=1,children:[e.jsx(d,{size:16}),"Précédent"]}),e.jsxs("span",{className:"rounded-xl border border-border bg-surface2 px-3 py-2 text-xs font-semibold uppercase tracking-[0.16em] text-textMuted",children:["Page ",s," / ",r]}),e.jsxs("button",{type:"button",className:"btn-secondary inline-flex items-center gap-2 px-3 py-2",onClick:()=>a(s+1),disabled:s>=r,children:["Suivant",e.jsx(o,{size:16})]})]})]})}export{b as P};
