1import{aJ as i,aK as x,aP as u}from"./index-zLT88wvs.js";import{P as h}from"./index-D6T1fpbh.js";import{u as g}from"./useResponsiveColumns-DBhtZkAP.js";import{h as p}from"./DashboardRouter.component-CfwN8pQV.js";import{u as T}from"./useHeritageTable-_-osRIdp.js";import"./PlusOutlined-DzQCpQq6.js";import"./PlusOutlined-ByZyTB3m.js";import"./EditOutlined-Da3qutGE.js";import"./index-DloMcKIe.js";const d={1:"contentType.document",2:"contentType.video",3:"contentType.audio",4:"contentType.image",5:"contentType.presentation",6:"contentType.activity",7:"contentType.file",8:"contentType.link",9:"contentType.text",10:"contentType.multimedia",11:"contentType.pdf",12:"contentType.word",13:"contentType.excel",14:"contentType.powerpoint",15:"contentType.zip",0:"contentType.noType"},w=({value:e,record:n})=>{const{t}=x(),o=[e,n?.content_type_id,n?.contentTypeId,n?.content_type?.id,n?.type,n?.type_id].filter(a=>a!=null)[0];let s=t("contentType.notSpecified"),r=!1;if(o!=null){const a=d[o]||d[Number(o)];a?s=t(a):(s=t("contentType.unknown",{id:o}),r=!0)}return i.jsx("div",{style:{padding:"4px 8px",borderRadius:"4px",display:"inline-block",fontSize:"12px",fontWeight:"500",maxWidth:"120px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",border:r?"1px solid #ff9800":"none"},children:s})},v=({text:e})=>{if(!e)return i.jsx("span",{style:{color:"#999"},children:"-"});const n=e.length>255?e.substring(0,255)+"...":e,t=window.innerWidth<=650;return i.jsx("div",{style:{width:"100%",minHeight:"20px",maxHeight:t?"80px":"100px",overflowY:"auto",whiteSpace:"pre-wrap",wordWrap:"break-word",wordBreak:"break-word",lineHeight:"1.3",padding:"2px 0",fontSize:t?"12px":"13px",color:"#333",cursor:"help"},title:e,children:n})},c=[{name:"Date",key:"date",filter:"text",width:120,fixed:!1,ellipsis:!1},{name:"Name",key:"name",filter:"text",width:180,fixed:!1,ellipsis:!1},{name:"Description",key:"description",filter:"text",width:350,fixed:!1,ellipsis:!1,render:e=>i.jsx(v,{text:e})},{name:"Content type",key:"content_type_id",filter:"text",width:140,fixed:!1,ellipsis:!1,render:(e,n)=>i.jsx(w,{value:e,record:n})}];function N(){const{loading:e,data:n,pagination:t,loadData:l,handleSearch:o,handleDelete:s,error:r}=T({fetchData:p.content?.getAllHeritageContent,deleteItem:p.content?.deleteHeritageContentById,columns:c}),f={title:"Heritage Content",entity:"heritage content",columns:g(c),actions:["edit","remove","map"],hasRowSelection:!1,defaultFilter:{},data:n};return i.jsxs("div",{className:"content heritage-content-table",children:[r&&i.jsx("div",{className:"error-message",children:r}),e?i.jsx(u,{}):i.jsx(h,{props:{...f,onAdd:()=>l(t.currentPage,t.pageSize),onUpdate:()=>l(t.currentPage,t.pageSize),onDelete:s,pagination:t,onPaginationChange:async(y,m)=>{await l(y,m)},onSearch:o}})]})}export{N as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.