import{iv as x,i$ as m,fH as s,bL as n,au as P,iG as b,hi as M,id as C,gH as I,aZ as g,C as y,$ as E,A as u,cl as c,aD as l,fI as L,bV as p}from"./strapi-ye6TfKul.js";const A=()=>{const{formatMessage:e}=x(),{notifyStatus:t}=P(),{toggleNotification:a}=b(),{_unstableFormatAPIError:d}=M(),{isLoading:f,data:i,error:r}=C();return I.useEffect(()=>{i&&t(e({id:"app.utils.notify.data-loaded",defaultMessage:"The {target} has loaded"},{target:e({id:"global.plugins",defaultMessage:"Plugins"})})),r&&a({type:"danger",message:d(r)})},[i,r,d,e,t,a]),f?s.jsx(n.Loading,{}):s.jsx(s.Fragment,{children:s.jsxs(n.Main,{children:[s.jsx(g.Header,{title:e({id:"global.plugins",defaultMessage:"Plugins"}),subtitle:e({id:"app.components.ListPluginsPage.description",defaultMessage:"List of the installed plugins in the project."})}),s.jsx(g.Content,{children:s.jsxs(y,{colCount:2,rowCount:i?.plugins?.length??1,children:[s.jsx(E,{children:s.jsxs(u,{children:[s.jsx(c,{children:s.jsx(l,{variant:"sigma",textColor:"neutral600",children:e({id:"global.name",defaultMessage:"Name"})})}),s.jsx(c,{children:s.jsx(l,{variant:"sigma",textColor:"neutral600",children:e({id:"global.description",defaultMessage:"description"})})})]})}),s.jsx(L,{children:i?.plugins.map(({name:o,displayName:h,description:j})=>s.jsxs(u,{children:[s.jsx(p,{children:s.jsx(l,{textColor:"neutral800",variant:"omega",fontWeight:"bold",children:e({id:`global.plugins.${o}`,defaultMessage:h})})}),s.jsx(p,{children:s.jsx(l,{textColor:"neutral800",children:e({id:`global.plugins.${o}.description`,defaultMessage:j})})})]},o))})]})})]})})},v=()=>{const{formatMessage:e}=x(),t=m(a=>a.admin_app.permissions);return s.jsxs(n.Protect,{permissions:t.marketplace?.main,children:[s.jsx(n.Title,{children:e({id:"global.plugins",defaultMessage:"Plugins"})}),s.jsx(A,{})]})};export{A as InstalledPlugins,v as ProtectedInstalledPlugins};
