import{_ as v}from"./AdminLayout-bd13ff9d.js";import{_ as x}from"./Paginate-f61b79b2.js";import{_ as C}from"./NoDataFound-bc81d7fa.js";import{_ as B}from"./PageHeader-8c638686.js";import{s as $,h as f,c as l,a as r,b as e,t as o,u as s,F as N,r as V,i as z,g as A,o as n,p as a,e as i,k as y,j as I}from"./app-13978987.js";import"./dropdown-45d66330.js";const L={class:"container flex-grow p-4 sm:p-6"},T={class:"space-y-6"},j={class:"table-responsive whitespace-nowrap rounded-primary"},D={class:"table"},F={class:"text-right"},M={key:0},S=["href"],E=["src"],O=["href"],R={class:"h-14 w-24"},U=["src"],Y=["href"],q={class:"w-full"},G=["src"],H=["src"],J={key:0,class:"flex items-center gap-3"},K=["src"],P={class:"dropdown","data-placement":"bottom-start"},Q={class:"dropdown-toggle"},W={class:"dropdown-content w-40"},X={class:"dropdown-list"},Z={class:"dropdown-list-item"},ee=["onClick"],te=A({layout:v}),ce=Object.assign(te,{__name:"Index",props:["assets"],setup(c){const{deleteRow:k,uiAvatar:g}=$();return(_,oe)=>{const w=f("Link"),u=f("Icon");return n(),l("main",L,[r(B),e("div",T,[e("div",j,[e("table",D,[e("thead",null,[e("tr",null,[e("th",null,o(s(a)("Asset")),1),e("th",null,o(s(a)("User")),1),e("th",null,o(s(a)("Type")),1),e("th",null,o(s(a)("Media Type")),1),e("th",null,o(s(a)("Size")),1),e("th",null,[e("p",F,o(s(a)("Action")),1)])])]),c.assets.total?(n(),l("tbody",M,[(n(!0),l(N,null,V(c.assets.data,(t,b)=>{var h,p,m;return n(),l("tr",{key:b},[e("td",null,[t.mime_type=="image"?(n(),l("a",{key:0,href:t.path,target:"_blank"},[e("img",{src:t.path,class:"h-14 rounded-lg",alt:""},null,8,E)],8,S)):i("",!0),t.mime_type=="video"?(n(),l("a",{key:1,href:t.path,target:"_blank"},[e("video",R,[e("source",{src:t.path,type:"video/mp4"},null,8,U)])],8,O)):i("",!0),t.mime_type=="audio"?(n(),l("a",{key:2,href:t.path,target:"_blank"},[e("audio",q,[e("source",{src:t.path,type:"audio/wav"},null,8,G),e("source",{src:t.path,type:"audio/mp3"},null,8,H),y(" Your browser does not support the audio element. ")])],8,Y)):i("",!0)]),e("td",null,[t.user?(n(),l("div",J,[e("img",{class:"h-10 rounded-full",src:s(g)((h=t.user)==null?void 0:h.name,(p=t.user)==null?void 0:p.avatar)},null,8,K),e("div",null,[r(w,{href:_.route("admin.users.show",t.user.id),class:"font-bold"},{default:I(()=>{var d;return[y(o((d=t.user)==null?void 0:d.name),1)]}),_:2},1032,["href"]),e("p",null,o((m=t.user)==null?void 0:m.email),1)])])):i("",!0)]),e("td",null,o(t.type),1),e("td",null,o(t.mime_type),1),e("td",null,o(t.file_size)+" MB",1),e("td",null,[e("div",P,[e("div",Q,[r(u,{class:"text-2xl",icon:"bx:dots-horizontal-rounded"})]),e("div",W,[e("ul",X,[e("li",Z,[e("button",{onClick:d=>s(k)(_.route("admin.user-logs.assets.destroy",t)),class:"dropdown-link"},[r(u,{icon:"fe:trash"}),e("span",null,o(s(a)("Delete")),1)],8,ee)])])])])])])}),128))])):(n(),z(C,{key:1,"for-table":!0}))]),r(x,{links:c.assets.links},null,8,["links"])])])])}}});export{ce as default};
