whoami7 - Manager
:
/
home
/
qbizpnmr
/
arif.umairtax.com
/
public
/
Upload File:
files >> /home/qbizpnmr/arif.umairtax.com/public/PreviousNextNavigation-zAd8_mLU.js
import{bS as k,u as y,a9 as A,ce as E,a as T,bu as S,aq as q,p as C,j as i,a$ as $,b2 as b,cf as z,cg as D,H as Q,i as w}from"./bundle.OlIVtvc7.js";const N=Q.div` background-color: ${r=>r.theme.backgroundColor}; border-color: ${r=>r.theme.borderColor}; &:hover { background-color: ${r=>r.theme.hoverColor}; } `;function W({entity:r,entityEndpointName:j}){const{id:d}=k();if(!d)return null;const[c]=y(),h=A(),m=E(),n=T(),g=S(),{isEditPage:p}=q({entity:r}),[a,x]=C.useState([]),u=()=>{const e=a.findIndex(t=>t.id===d);return e===0?null:e-1},l=()=>{const e=a.findIndex(t=>t.id===d);return e===a.length-1?null:e+1},I=()=>{const e=u();e!==null&&h(w(`/${r}s/:id/${p?"edit":""}`,{id:a[e].id}))},P=()=>{const e=l();e!==null&&h(w(`/${r}s/:id/${p?"edit":""}`,{id:a[e].id}))};return C.useEffect(()=>{const e=g.getQueryCache().findAll({queryKey:[`/api/v1/${j??r}s`]}).filter(t=>{var o,s,f,v;return((s=(o=t.state.data)==null?void 0:o.data)==null?void 0:s.data)&&Array.isArray((v=(f=t.state.data)==null?void 0:f.data)==null?void 0:v.data)}).flatMap(t=>{var o,s;return(s=(o=t.state.data)==null?void 0:o.data)==null?void 0:s.data}).reduce((t,o)=>(t.some(s=>s.id===o.id)||t.push(o),t),[]).sort((t,o)=>t.created_at-o.created_at);return x(e),()=>x([])},[g]),!a.length||a.length===1||a.length&&!a.find(e=>e.id===d)?null:i.jsxs("div",{className:"relative flex flex-1 space-x-2 items-center justify-end",children:[i.jsx($,{message:c("previous"),width:"auto",placement:"bottom",withoutArrow:!0,withoutWrapping:!0,children:i.jsx(N,{className:b("p-2 sm:p-[0.725rem] border rounded-md shadow-sm",{"cursor-not-allowed opacity-50":u()===null,"cursor-pointer":u()!==null}),onClick:()=>{m({fn:()=>I()})},theme:{hoverColor:n.$4,backgroundColor:n.$1,borderColor:n.$24},children:i.jsx(z,{size:"0.9rem",color:n.$3})})}),i.jsx($,{message:c("next"),width:"auto",placement:"bottom",withoutArrow:!0,withoutWrapping:!0,children:i.jsx(N,{className:b("p-2 sm:p-[0.725rem] border rounded-md shadow-sm",{"cursor-not-allowed opacity-50":l()===null,"cursor-pointer":l()!==null}),onClick:()=>{m({fn:()=>P()})},theme:{hoverColor:n.$4,backgroundColor:n.$1,borderColor:n.$24},children:i.jsx(D,{size:"0.9rem",color:n.$3})})})]})}export{W as P};
Copyright ©2021 || Defacer Indonesia