import{_ as y}from"./UserLayout-6a50516d.js";import{_ as x}from"./PageHeader-8c638686.js";import{_ as v}from"./NoDataFound-bc81d7fa.js";import{s as k,h as i,c as o,a as d,b as s,t,F as u,r as _,i as m,g as C,o as a,j as w,n as p,k as $,e as j}from"./app-13978987.js";import"./dropdown-45d66330.js";const B={class:"container flex-grow p-4 sm:p-6"},N={class:"mb-3 flex max-w-max items-center space-x-2 rounded-lg border bg-white p-1 dark:border-slate-600 dark:bg-slate-800"},P={class:"ml-3"},V=["src","alt"],z={class:"space-y-6"},D={class:"table-responsive whitespace-nowrap rounded-primary"},I={class:"table"},L={class:"!text-end"},A={key:0},E={class:"flex items-center gap-2 text-left"},F={class:"text-xs capitalize"},O={class:"flex items-center gap-2"},R=["src"],S=s("br",null,null,-1),T={key:0},q={class:"flex justify-end gap-1"},G=["onClick"],H=C({layout:y}),W=Object.assign(H,{__name:"Index",props:["buttons","platforms","activePlatforms"],setup(l){const{deleteRow:g}=k(),h=n=>{g(route("user.platforms.destroy",n.id))};return(n,r)=>{const b=i("Link"),f=i("Icon");return a(),o("main",B,[d(x),s("div",N,[s("p",P,t(n.trans("Connect"))+":",1),(a(!0),o(u,null,_(l.activePlatforms,e=>(a(),m(b,{key:e,href:n.route(`connect.${e}`),class:"btn py-3 hover:bg-gray-200 dark:hover:bg-gray-700 sm:px-8"},{default:w(()=>[s("img",{class:"w-4",src:`/assets/svg/${e}.svg`,alt:e},null,8,V)]),_:2},1032,["href"]))),128))]),s("div",z,[s("div",D,[s("table",I,[s("thead",null,[s("tr",null,[s("th",null,t(n.trans("Platform")),1),s("th",null,t(n.trans("Details")),1),s("th",null,t(n.trans("Connected As")),1),s("th",L,t(n.trans("Action")),1)])]),l.platforms.length?(a(),o("tbody",A,[(a(!0),o(u,null,_(l.platforms,e=>(a(),o("tr",{key:e},[s("td",null,[s("div",E,[s("i",{class:p(["bx text-2xl",`bxl-${e.platform}`])},null,2),s("span",F,t(e.platform),1)])]),s("td",null,[s("div",O,[s("img",{src:e.picture??"/assets/images/no-image.jpg",onError:r[0]||(r[0]=c=>c.target.src="/assets/images/no-image.jpg"),class:"h-10 w-10 rounded-full object-cover"},null,40,R),s("span",null,[$(t(e.name)+" ",1),S,e.username?(a(),o("small",T,"("+t(e.username)+")",1)):j("",!0)])])]),s("td",null,[s("div",{class:p(["badge capitalize",{"badge-primary":e.type=="user","badge-success":e.type=="page"}])},t(e.type),3)]),s("td",null,[s("div",q,[s("button",{onClick:c=>h(e),type:"submit",class:"btn btn-danger btn-xs"},[d(f,{icon:"bx:bxs-x-circle"}),s("span",null,t(n.trans("Disconnect")),1)],8,G)])])]))),128))])):(a(),m(v,{key:1,"for-table":"true"}))])])])])}}});export{W as default};
