import{aV as s,aW as l,j as a,J as d,aX as u}from"./index-CHfgriyV.js";import{u as m}from"./useSuspenseQuery-Cya_zjFk.js";import{M as h}from"./main-D1eRPv4V.js";import{u as x,I as f,a as j}from"./use-authentication-etG0G-sB.js";import"./alert-ByJNgWtG.js";import"./logo-YT1RHN33.js";import"./useMutation-DgMLlnbr.js";function _(){const e=s.useSearch(),i=s.useLoaderData(),{isAuthenticated:n}=x(),o=m(l({page:e.page,perPage:e.per_page})),p=o.data.items,r=s.useNavigate(),g=e.page>0?()=>{r({search:t=>({...t,page:e.page-1})})}:void 0,c=(e.page+1)*e.per_page<o.data.total?()=>{r({search:t=>({...t,page:e.page+1})})}:void 0;return a.jsx(h,{icon:"plug",iconBadgeType:"accent",title:"Integrations",description:"Extend Plakar with integrations.",children:a.jsxs("div",{className:"flex flex-col gap-6",children:[!n&&a.jsx(f,{os:i.item.os,arch:i.item.arch}),o.data.total===0&&a.jsx(d,{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-3 md:grid-cols-2 lg:grid-cols-3",children:p.map(t=>a.jsx(j,{integration:t,documentationProps:{href:{to:"/integrations/$integrationId",params:{integrationId:t.id}}},installDisabled:!n},t.id))}),a.jsx(u,{currentPage:e.page,total:{count:o.data.total,perPage:e.per_page},onPrev:g,onNext:c})]})})}export{_ as component};
