import{_ as f}from"./AdminLayout-bd13ff9d.js";import{_ as y}from"./PageHeader-8c638686.js";import{_ as k}from"./NoDataFound-bc81d7fa.js";import{s as v,c as a,a as $,b as s,t,u as o,F as C,r as w,i as B,g as N,o as n,p as l,e as g,n as V,k as j}from"./app-13978987.js";import"./dropdown-45d66330.js";const A={class:"container flex-grow p-4 sm:p-6"},D={class:"space-y-6"},E={class:"table-responsive whitespace-nowrap rounded-primary"},F={class:"table"},P={class:"!text-end"},T={key:0},z={key:0,class:"flex items-center gap-3"},I=["src"],L=["href"],O={class:"ml-3 text-left"},R={class:"flex items-center gap-2"},S=["src"],U=s("br",null,null,-1),q={key:0},G={class:"!text-end"},H=["onClick"],J=N({layout:f}),Y=Object.assign(J,{__name:"Index",props:["countTotal","platforms"],setup(r){const{deleteRow:b}=v(),x=c=>{b(route("admin.user-logs.platforms.destroy",c.id))};return(c,i)=>(n(),a("main",A,[$(y),s("div",D,[s("div",E,[s("table",F,[s("thead",null,[s("tr",null,[s("th",null,t(o(l)("User")),1),s("th",null,t(o(l)("Platform")),1),s("th",null,t(o(l)("Account")),1),s("th",null,t(o(l)("Connected As")),1),s("th",P,t(o(l)("Action")),1)])]),r.platforms.total?(n(),a("tbody",T,[(n(!0),a(C,null,w(r.platforms.data,e=>{var d,u,_,m,h;return n(),a("tr",{key:e},[s("td",null,[e.user?(n(),a("div",z,[s("img",{class:"h-10 rounded-full",src:((d=e.user)==null?void 0:d.avatar)==null?`https://ui-avatars.com/api/?name=${(u=e.user)==null?void 0:u.name}`:`${(_=e.user)==null?void 0:_.avatar}`},null,8,I),s("div",null,[s("a",{href:`/admin/users/${e.user.id}`,class:"font-bold"},t((m=e.user)==null?void 0:m.name),9,L),s("p",null,t((h=e.user)==null?void 0:h.email),1)])])):g("",!0)]),s("td",null,[s("div",O,[s("i",{class:V(["bx text-2xl",`bxl-${e.platform}`])},null,2)])]),s("td",null,[s("div",R,[s("img",{src:e.picture??"/assets/images/no-image.jpg",onError:i[0]||(i[0]=p=>p.target.src="/assets/images/no-image.jpg"),class:"h-10"},null,40,S),s("span",null,[j(t(e.name)+" ",1),U,e.username?(n(),a("small",q,"("+t(e.username)+")",1)):g("",!0)])])]),s("td",null,t(e.type),1),s("td",G,[s("button",{onClick:p=>x(e),type:"submit",class:"btn btn-danger btn-xs"}," Disconnect ",8,H)])])}),128))])):(n(),B(k,{key:1,"for-table":"true"}))])])])]))}});export{Y as default};
