import{J as x,j as e}from"./app-BBZbvTSO.js";import{C as g}from"./checkbox-B0_9jnY6.js";import{B as u}from"./badge-BR_GnIty.js";import{T as h,a as f,b as m,c as i,d as j,e as t}from"./table-BDtwArHp.js";import N from"./AssetActionMenu-D0cCgiLZ.js";import{f as b}from"./format-C_TaVLmE.js";import{F as w}from"./file-image-DFth2BDy.js";import{F as v,a as y,b as _}from"./file-rNzbEzLm.js";import{F as C}from"./file-text-DfpLAAwR.js";/* empty css            */import"./utils-YhN_nlHn.js";import"./index-CbDI-tXU.js";import"./index-BCYyBCUm.js";import"./index-AiAmtg3H.js";import"./index-C1VwruLz.js";import"./index-13DH8-b5.js";import"./check-yuW7wFtQ.js";import"./button-CZmOQP7j.js";import"./dropdown-menu-DkvU_mzU.js";import"./index-IvSACaye.js";import"./index-BosTFUDi.js";import"./Combination-9YgcTppv.js";import"./index-hDbW6ayQ.js";import"./floating-ui.dom-DtF1XweH.js";import"./index-Dbn6AP0q.js";import"./ellipsis-vertical-DoJR9-bA.js";import"./eye-v-dyI3tg.js";import"./download-grDUn2Jg.js";import"./trash-O7-xigMm.js";const o=a=>{const l=a.extension.toLowerCase();return["jpg","jpeg","png","gif","webp","svg"].includes(l)?e.jsx(w,{className:"h-6 w-6 text-blue-500"}):["mp4","webm","mov"].includes(l)?e.jsx(v,{className:"h-6 w-6 text-red-500"}):["mp3","wav","ogg"].includes(l)?e.jsx(y,{className:"h-6 w-6 text-green-500"}):["pdf","doc","docx","txt","rtf"].includes(l)?e.jsx(C,{className:"h-6 w-6 text-yellow-500"}):e.jsx(_,{className:"h-6 w-6 text-gray-500"})},T=a=>{const l=a.toLowerCase();return["jpg","jpeg","png","gif","webp","svg"].includes(l)?"hover:bg-blue-50 dark:hover:bg-blue-950/20":["mp4","webm","mov"].includes(l)?"hover:bg-red-50 dark:hover:bg-red-950/20":["mp3","wav","ogg"].includes(l)?"hover:bg-green-50 dark:hover:bg-green-950/20":["pdf","doc","docx","txt","rtf"].includes(l)?"hover:bg-yellow-50 dark:hover:bg-yellow-950/20":""};function le({assets:a,selectedAssets:l,onAssetSelect:c,onViewDetails:d,onDelete:p}){const s=x().props.userCan;return a.length===0?e.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No assets found"}):e.jsx("div",{className:"rounded-md overflow-hidden",children:e.jsxs(h,{children:[e.jsx(f,{className:"bg-muted/50",children:e.jsxs(m,{className:"hover:bg-muted/50",children:[s.delete_asset&&e.jsx(i,{className:"w-10 align-middle text-center"}),e.jsx(i,{className:"w-12 align-middle text-center"}),e.jsx(i,{className:"align-middle",children:"Name"}),e.jsx(i,{className:"align-middle",children:"Type"}),e.jsx(i,{className:"align-middle",children:"Size"}),e.jsx(i,{className:"align-middle",children:"Date Added"}),(s.update_asset||s.delete_asset)&&e.jsx(i,{className:"w-10 align-middle text-center",children:"Actions"})]})}),e.jsx(j,{children:a.map(r=>{var n;return e.jsxs(m,{className:T(r.extension),children:[e.jsx(t,{className:"py-2 align-middle",children:e.jsx(g,{checked:l.includes(r.id),onCheckedChange:()=>c(r.id)})}),e.jsx(t,{className:"py-2 align-middle text-center",children:r.thumbnail_url?e.jsx("div",{className:"h-10 w-10 overflow-hidden",children:e.jsx("img",{src:r.thumbnail_url,alt:((n=r.metadata)==null?void 0:n.alt_text)||r.original_filename,className:"h-full w-full object-cover"})}):e.jsx("div",{className:"h-10 w-10 flex items-center justify-center",children:o(r)})}),e.jsx(t,{className:"py-2 align-middle",children:e.jsx("span",{className:"cursor-pointer hover:underline",onClick:()=>d(r),children:r.original_filename})}),e.jsx(t,{className:"py-2 align-middle",children:e.jsxs(u,{variant:"outline",className:"flex items-center gap-1 px-2 py-1",children:[o(r),e.jsx("span",{children:r.extension.toUpperCase()})]})}),e.jsx(t,{className:"py-2 text-muted-foreground text-sm",children:r.formatted_size}),e.jsx(t,{className:"py-2 align-middle text-sm text-muted-foreground",children:b(new Date(r.created_at),"PP")}),(s.update_asset||s.delete_asset)&&e.jsx(t,{className:"py-2 text-center align-middle",children:e.jsx(N,{asset:r,onViewDetails:d,onDelete:p,canUpdate:s.update_asset,canDelete:s.delete_asset})})]},r.id)})})]})})}export{le as default};
