import{a as x,aA as b,j as s,P as n,aB as m,w as P,v as M,bs as T,r as y,B as d,bd as C,be as E,bf as u,bg as c,T as l,bj as I,bk as p}from"./strapi-D_Y4QZhh.js";const A=()=>{const{formatMessage:e}=x(),{notifyStatus:a}=m(),{toggleNotification:t}=P(),{_unstableFormatAPIError:g}=M(),{isLoading:h,data:i,error:r}=T();return y.useEffect(()=>{i&&a(e({id:"app.utils.notify.data-loaded",defaultMessage:"The {target} has loaded"},{target:e({id:"global.plugins",defaultMessage:"Plugins"})})),r&&t({type:"danger",message:g(r)})},[i,r,g,e,a,t]),h?s.jsx(n.Loading,{}):s.jsx(d.Root,{children:s.jsxs(n.Main,{children:[s.jsx(d.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(d.Content,{children:s.jsxs(C,{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(I,{children:i?.plugins.map(({name:o,displayName:f,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:f})})}),s.jsx(p,{children:s.jsx(l,{textColor:"neutral800",children:e({id:`global.plugins.${o}.description`,defaultMessage:j})})})]},o))})]})})]})})},v=()=>{const{formatMessage:e}=x(),a=b(t=>t.admin_app.permissions);return s.jsxs(n.Protect,{permissions:a.marketplace?.main,children:[s.jsx(n.Title,{children:e({id:"global.plugins",defaultMessage:"Plugins"})}),s.jsx(A,{})]})};export{A as InstalledPlugins,v as ProtectedInstalledPlugins};
