import{_ as E}from"./nuxt-link.0e2876ca.js";import{_ as H}from"./Input.7105798b.js";import z from"./Icon.1464d3c9.js";import{_ as G}from"./Button.c35f3c05.js";import{_ as j}from"./Table.e164c81e.js";import{_ as J}from"./Pagination.967f26ab.js";import{_ as N,bF as I,bE as L,aL as b,bq as v,o as $,c as M,b as o,w as r,a,d as l,t as p,ba as u,ah as U,F as K,p as Q,e as W,u as X,bG as Y,bu as Z,bz as ee,bD as te}from"./entry.816e6e91.js";import{_ as ae}from"./card.924cd882.js";import"./Button.8c8352d3.js";import"./index.84e04faa.js";const A=s=>(Q("data-v-f9272589"),s=s(),W(),s),se={class:"d-flex align-items-center"},oe=["src"],le={class:"badge bg-success"},ne=A(()=>a("br",null,null,-1)),re={class:"badge bg-success"},_e=A(()=>a("br",null,null,-1)),ce={class:"badge bg-success"},ue={__name:"List",props:{pending:{type:Boolean},sellers:{type:Array,default:()=>[]},page:{type:Number,default:1},total:{type:Number,default:1}},setup(s){const n=I(),g=L(),y=s,_=[{key:"id",label:"ID"},{key:"name",label:"Full Name"},{key:"username",label:"Username"},{key:"user_type",label:"User Type",sortable:!0},{key:"mobile_number",label:"Mobile Number"},{key:"statistics",label:"Statistics"},{key:"created_at",label:"Date",sortable:!0}];let t=b();t.value=y.page;let i=b("");return v(()=>n.query,()=>{i.value=n.query.search,t.value=+n.query.page||y.page},{immediate:!0}),v(t,()=>{g.push({query:{page:t.value,search:i.value}})}),(f,c)=>{const h=j,w=J;return $(),M(K,null,[o(h,{columns:_,rows:s.sellers,loading:s.pending,"loading-state":{label:"Loading..."}},{"name-data":r(({row:e})=>[a("div",se,[a("img",{src:e.img,alt:"Image",class:"rounded me-2",width:"40",height:"40"},null,8,oe),l(" "+p(e.fullname),1)])]),"statistics-data":r(({row:e})=>[l(" Followers: "),a("span",le,p(e.totalOfMyFollowers),1),l(),ne,l(" Following: "),a("span",re,p(e.totalOfMyFollows),1),l(),_e,l(" Posts: "),a("span",ce,p(e.totalOfMyPosts),1)]),"created_at-data":r(({row:e})=>[l(p(new Date(e.created_at).getHours()+":"+new Date(e.created_at).getMinutes()+", "+new Date(e.created_at).toDateString()),1)]),_:1},8,["rows","loading","loading-state"]),o(w,{modelValue:u(t),"onUpdate:modelValue":c[0]||(c[0]=e=>U(t)?t.value=e:t=e),"page-count":10,total:s.total},null,8,["modelValue","total"])],64)}}},ie=N(ue,[["__scopeId","data-v-f9272589"]]);const de={class:"row mx-0"},me={class:"d-flex flex-wrap mb-4 px-3"},pe=["onSubmit"],be={class:"col-lg-12"},ge={__name:"index",async setup(s){var S;let n,g;X({title:"Sellers List"});const y=Y();y.pageName="Sellers List";const _=I(),t=L();let i=b(""),f=b();const{data:c,pending:h,execute:w}=([n,g]=Z(()=>te({url:"seller/search/10",method:"post"},{immediate:!1,body:{s:i},query:{page:f}})),n=await n,g(),n);v(()=>_.query,()=>{var x,d;i.value=((x=_.query)==null?void 0:x.search)||"",f.value=((d=_.query)==null?void 0:d.page)||1},{immediate:!0});let e=b("");e.value=(S=_.query)==null?void 0:S.search;const B=()=>{t.push({query:{page:1,search:e.value}})};return(x,d)=>{const k=E,R=H,C=z,O=G,P=ie,T=ae;return $(),M("div",de,[a("div",me,[o(k,{to:"/admin/sellers",class:"nav-tab btn btn-dark me-2 active"},{default:r(()=>[l("All")]),_:1}),o(k,{to:"/admin/sellers/sellers-requests",class:"nav-tab btn me-3 btn-dark"},{default:r(()=>[l("New Requests")]),_:1}),a("form",{onSubmit:ee(B,["prevent"]),class:"d-flex mt-4 mt-md-0"},[o(R,{class:"search__input me-2",placeholder:"Search by customer id, mobile number, username",modelValue:u(e),"onUpdate:modelValue":d[0]||(d[0]=m=>U(e)?e.value=m:e=m)},null,8,["modelValue"]),o(O,{color:"dark",type:"submit"},{default:r(()=>[o(C,{name:"material-symbols:search"})]),_:1})],40,pe)]),a("div",be,[o(T,{bodyClasses:"mt-2"},{body:r(()=>{var m,q,V,D,F;return[o(P,{pending:u(h),sellers:(m=u(c))==null?void 0:m.data,page:(V=(q=u(c))==null?void 0:q.meta)==null?void 0:V.current_page,total:(F=(D=u(c))==null?void 0:D.meta)==null?void 0:F.total},null,8,["pending","sellers","page","total"])]}),_:1})])])}}},De=N(ge,[["__scopeId","data-v-2fa9ee00"]]);export{De as default};
