import{c as l,j as t,H as n}from"./app-BiexncSX.js";import{A as d}from"./app-layout-BB5SDrLz.js";import{I as c}from"./IndexPageLayout-vH6paYeM.js";import{T as x}from"./TablePagination-UgcD3bCc.js";import{P as h,a as f,b as u}from"./popover-BxvDGqL9.js";import{S as j}from"./separator-BE6xCedb.js";import{D as g}from"./DeleteAlertButton-l5BS49Zq.js";/* empty css            */import"./sonner-8z7PTnwf.js";import"./index-BphRgCCf.js";import"./loader-circle-C36m3ppM.js";import"./createLucideIcon-CiyItOCI.js";import"./triangle-alert-Dp60wOMH.js";import"./index-BLf-KPWz.js";import"./button-Cwvd_D5X.js";import"./utils-DvRnx1Xn.js";import"./index-Bx9iUFeV.js";import"./index-BKRdUh5V.js";import"./index-DRVc8jnD.js";import"./index-CqDcnRSI.js";import"./x-Cp4MPESs.js";import"./tooltip-CFZPZp2b.js";import"./index-B9bcoF29.js";import"./index-3q7cNFQn.js";import"./index-vCsTGnV6.js";import"./index-BxgPClSG.js";import"./index-CW_Do8vH.js";import"./index-BzyVuPsA.js";import"./sun-D646Bdfj.js";import"./index-jmbesBs1.js";import"./index-Dql7-O7m.js";import"./index-DDBh_SM-.js";import"./chevrons-up-down-B23gAN10.js";import"./bed-double-DlbqgL2k.js";import"./utensils-CU7nxPop.js";import"./globe-CZ3jv1ui.js";import"./chevron-right-D-bIFB2o.js";import"./house-CmuRWHdh.js";import"./lucide-react-C-jOYeYF.js";import"./send-D-Y6pdiK.js";import"./wifi-yGaHKi1T.js";import"./phone-Bieilqj-.js";import"./check-Do_LJdyj.js";import"./chevron-up-D0SwuXIU.js";import"./chevron-left-CfTNJLZd.js";import"./shield-check-BcGX3gbR.js";import"./youtube-C8R3zjo2.js";import"./plus-Cm0TKlUw.js";import"./clock-CXI9z3-R.js";import"./credit-card-DrNFemOT.js";import"./ellipsis-BcGSaUdp.js";import"./key-Dw2ORQjm.js";import"./loader-uls-v5oU.js";import"./minus-BQGRvjuE.js";import"./monitor-4BAY-8Q0.js";import"./save-BnaHUyyd.js";import"./search-DVB94mIy.js";import"./sparkles-duG_NONK.js";import"./trash-2-B8EoOc8P.js";import"./users-B6ln6dzh.js";import"./Icon-DEKRlUi3.js";import"./select-Oi4we0ay.js";import"./index-BdQq_4o_.js";import"./index-Crj9qdjp.js";import"./label-BACPLsln.js";import"./alert-dialog-Sv-TtVWh.js";import"./spinner-BshPoFqP.js";const y=[{title:"Images Manage",href:"/dashboard/images"}];function Bt(r){const e=l.c(10),{images:i}=r;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(n,{title:"Images Manage"}),e[0]=m):m=e[0];let s;e[1]!==i.data?(s=i.data.map(v),e[1]=i.data,e[2]=s):s=e[2];let a;e[3]!==s?(a=t.jsx("div",{className:"flex  flex-wrap gap-2",children:s}),e[3]=s,e[4]=a):a=e[4];let o;e[5]!==i?(o=t.jsx(x,{links:i.links,meta:i}),e[5]=i,e[6]=o):o=e[6];let p;return e[7]!==a||e[8]!==o?(p=t.jsxs(d,{breadcrumbs:y,children:[m,t.jsxs(c,{title:"Images Manage",path:"/dashboard/images",children:[a,o]})]}),e[7]=a,e[8]=o,e[9]=p):p=e[9],p}function v(r){return t.jsxs("div",{className:" rounded-sm overflow-hidden   hover:shadow transition w-fit",children:[t.jsx("div",{className:" aspect-5/3 h-30   flex items-center justify-center overflow-hidden",children:t.jsx("img",{src:r.url,alt:r.title??"image",className:"w-full h-full object-contain"})}),t.jsxs("div",{className:"p-3 space-y-1 text-sm",children:[t.jsx("p",{className:"font-medium truncate max-w-44",children:r.title??"Untitled"}),t.jsxs("p",{className:"text-gray-500 dark:text-gray-400 text-xs",children:[(r.file_size/1024).toFixed(1)," KB |  ",r.width," × ",r.height]}),t.jsxs("div",{className:"flex justify-between",children:[r.used_in.length>0?t.jsxs(h,{children:[t.jsxs(f,{className:"text-xs text-green-500 hover:text-green-400 transition underline pt-0 cursor-pointer",children:["View usage (",r.usage_count,")"]}),t.jsx(u,{className:"w-80 max-h-72 overflow-auto ",children:t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:r.title??"Untitled"}),t.jsx(j,{}),t.jsx("p",{className:"text-xs font-semibold text-gray-800 dark:text-gray-200",children:"Used Locations"}),t.jsx("div",{className:"space-y-1",children:r.used_in.map(N)})]})})]}):t.jsx("div",{className:"text-xs text-red-500 pt-1",children:"  Not used anywhere "}),t.jsx(g,{deleteId:r.id,model:"image-manage",title:"Image",variant:"ghost"})]})]})]},r.id)}function N(r,e){return t.jsxs("div",{className:"flex justify-between items-center  rounded text-sm border p-2 text-gray-700 dark:text-gray-300  transition",children:[t.jsxs("span",{className:"capitalize",children:[r.type," (#",r.id,")"]}),t.jsx("span",{className:" text-gray-500 dark:text-gray-400",children:r.role??"default"})]},e)}export{Bt as default};
