import{iv as x,ih as k,fH as e,iY as f,iF as m,C as w,fI as C,A as T,bV as i,bU as g,Y as v,aD as c,c0 as D,ch as b,gZ as E,a$ as R,d2 as M,jD as $}from"./strapi-ye6TfKul.js";import{W as o}from"./WidgetHelpers-DvKGKEsV.js";const p=$(c)`
  display: block;
  max-width: 14.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
`,A=({documents:l,type:t})=>{const{formatMessage:n}=x(),{trackUsage:r}=f(),h=m(),d=s=>{const a=s.kind==="singleType",j=a?"single-types":"collection-types",u=s.locale?`?plugins[i18n][locale]=${s.locale}`:"";return`/content-manager/${j}/${s.contentTypeUid}${a?"":"/"+s.documentId}${u}`},y=s=>()=>{r("willEditEntryFromHome",{entryType:t});const a=d(s);h(a)};return e.jsx(w,{colCount:6,rowCount:l?.length??0,children:e.jsx(C,{children:l?.map(s=>e.jsxs(T,{onClick:y(s),cursor:"pointer",children:[e.jsx(i,{children:e.jsx(p,{title:s.title,variant:"omega",textColor:"neutral800",children:s.title})}),e.jsx(i,{children:e.jsx(p,{variant:"omega",textColor:"neutral600",children:s.kind==="singleType"?n({id:"content-manager.widget.last-edited.single-type",defaultMessage:"Single-Type"}):n({id:s.contentTypeDisplayName,defaultMessage:s.contentTypeDisplayName})})}),e.jsx(i,{children:e.jsx(g,{display:"inline-block",children:s.status?e.jsx(v,{status:s.status}):e.jsx(c,{textColor:"neutral600","aria-hidden":!0,children:"-"})})}),e.jsx(i,{children:e.jsx(c,{textColor:"neutral600",children:e.jsx(D,{timestamp:new Date(s.updatedAt)})})}),e.jsx(i,{children:e.jsx(b,{strapi_stage:s.strapi_stage})}),e.jsx(i,{onClick:a=>a.stopPropagation(),children:e.jsx(g,{display:"inline-block",children:e.jsx(E,{tag:R,to:d(s),onClick:()=>r("willEditEntryFromHome",{entryType:t}),label:n({id:"content-manager.actions.edit.label",defaultMessage:"Edit"}),variant:"ghost",children:e.jsx(M,{})})})})]},s.documentId))})})},L=()=>{const{formatMessage:l}=x(),{data:t,isLoading:n,error:r}=k();return n?e.jsx(o.Loading,{}):r||!t?e.jsx(o.Error,{}):t.length===0?e.jsx(o.NoData,{children:l({id:"review-workflows.widget.assigned.no-data",defaultMessage:"No entries"})}):e.jsx(A,{documents:t,type:"assigned"})};export{L as AssignedWidget};
