import{au as r,av as c,j as a}from"./index-BX768Frx.js";import{P as d}from"./select-fQyM9_P4.js";import{u as m}from"./useSuspenseQuery-Br7OCbDP.js";import{E as u}from"./empty-list-CHaQSvfG.js";import{u as h,I as f,a as x}from"./use-authentication-D_eVmV_W.js";import{M as j}from"./main-B6XIaWoX.js";import"./useBaseQuery-DCSHiJ5h.js";import"./alert-BrzNrLBf.js";import"./tag-DIbqHQC5.js";import"./useQuery-DHwdh6Ld.js";function k(){const t=r.useSearch(),[v,s]=r.useLoaderData(),{isAuthenticated:i}=h(),o=m(c({page:t.page,perPage:t.per_page})),p=o.data.items,n=r.useNavigate(),g=t.page>0?()=>{n({search:e=>({...e,page:t.page-1})})}:void 0,l=(t.page+1)*t.per_page<o.data.total?()=>{n({search:e=>({...e,page:t.page+1})})}:void 0;return a.jsx(j,{title:"Integrations",description:"Extend Plakar with integrations.",children:a.jsxs("div",{className:"flex flex-col gap-4",children:[!i&&a.jsx(f,{os:s.item.os,arch:s.item.arch}),o.data.total===0&&a.jsx(u,{title:"No integrations found",description:"Here, you should see all the integrations available for Plakar. Unfortunately, there are none at the moment.",illustrationType:"juggles_nuts"}),a.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:p.map(e=>a.jsx(x,{integration:e,documentationProps:{href:{to:"/integrations/$integrationId",params:{integrationId:e.id}}},installDisabled:!i},e.id))}),a.jsx(d,{currentPage:t.page,total:{count:o.data.total,perPage:t.per_page},onPrev:g,onNext:l})]})})}export{k as component};
