(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[844],{2434:function(e,r,s){Promise.resolve().then(s.bind(s,2925))},2925:function(e,r,s){"use strict";s.r(r),s.d(r,{default:function(){return c}});var l=s(7437),t=s(5939),a=s(5008),n=s(3145),i=s(9376),d=s(2265);function c(){var e,r,s,c,o,u;let{id:f}=(0,i.useParams)(),[m,x]=(0,d.useState)(!0),[h,v]=(0,d.useState)(),[b,g]=(0,d.useState)(),j=async()=>{try{let e=await a.Z.get("/buyer/detail/"+f);v(e.data.data)}catch(e){console.error("Error fetching buyer:",e)}},N=async()=>{try{let e=await a.Z.get("/buyer/address?userId="+f);g(e.data.data)}catch(e){console.error("Error fetching buyer address:",e)}};return((0,d.useEffect)(()=>{x(!0),Promise.all([j(),N()]).finally(()=>x(!1))},[f]),m)?(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-xl font-light mb-4",children:"Buyer"}),(0,l.jsx)(t.Z,{className:"flex p-6 space-x-6 w-5/12 animate-pulse",children:(0,l.jsxs)("div",{className:"space-y-2 w-full",children:[(0,l.jsx)("div",{className:"mb-4 bg-[#F5CEE0] rounded-xl w-full h-[350px]"}),(0,l.jsx)("div",{className:"h-6 bg-[#F5CEE0] rounded w-1/2 mb-2"}),(0,l.jsx)("div",{className:"h-5 bg-[#F5CEE0] rounded w-1/3 mb-2"}),(0,l.jsx)("div",{className:"h-5 bg-[#F5CEE0] rounded w-1/4 mb-2"}),(0,l.jsx)("div",{className:"h-5 bg-[#F5CEE0] rounded w-1/2 mb-2"}),(0,l.jsx)("div",{className:"h-5 bg-[#F5CEE0] rounded w-full mb-2"})]})})]}):(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-xl font-light mb-4",children:"Buyer"}),(0,l.jsx)(t.Z,{className:"flex p-6 space-x-6 w-5/12",children:(0,l.jsxs)("div",{className:"space-y-2 w-full",children:[(0,l.jsx)("div",{className:"mb-4",children:(0,l.jsx)(n.default,{src:"images/user_default.png",alt:(null==h?void 0:h.name)||"User Image",width:350,height:350,unoptimized:!0,className:"rounded-xl w-full",onError:e=>{e.target.src="/images/user_default.png"}})}),(0,l.jsx)("div",{className:"flex justify-between text-[0.9rem]",children:(0,l.jsx)("p",{className:"text-2xl font-medium",children:"Buyer Information"})}),(0,l.jsxs)("div",{className:"flex justify-between text-[0.9rem]",children:[(0,l.jsx)("p",{className:"",children:"Name:"}),(0,l.jsx)("p",{className:"font-light",children:null==h?void 0:h.name})]}),(0,l.jsxs)("div",{className:"flex justify-between text-[0.9rem]",children:[(0,l.jsx)("p",{className:"",children:"Email:"}),(0,l.jsx)("p",{className:"font-light",children:null==h?void 0:h.email})]}),(0,l.jsxs)("div",{className:"flex justify-between text-[0.9rem]",children:[(0,l.jsx)("p",{className:"",children:"Phone:"}),(0,l.jsx)("p",{className:"font-light",children:null==h?void 0:h.phone})]}),(0,l.jsxs)("div",{className:"text-[0.9rem]",children:[(0,l.jsx)("p",{className:"",children:"Address:"}),(0,l.jsx)("p",{className:"font-light text-gray-500",children:"".concat(null==b?void 0:null===(e=b[0])||void 0===e?void 0:e.road,", ").concat(null==b?void 0:null===(r=b[0])||void 0===r?void 0:r.detail,", ").concat(null==b?void 0:null===(s=b[0])||void 0===s?void 0:s.district,", ").concat(null==b?void 0:null===(c=b[0])||void 0===c?void 0:c.city,", ").concat(null==b?void 0:null===(o=b[0])||void 0===o?void 0:o.province,", ").concat(null==b?void 0:null===(u=b[0])||void 0===u?void 0:u.postcode)})]})]})})]})}},5939:function(e,r,s){"use strict";s.d(r,{Z:function(){return i}});var l=s(7437),t=s(2265),a=s(7053),n=s(4508);let i=t.forwardRef((e,r)=>{let{className:s,asChild:t,...i}=e,d=t?a.g7:"div";return(0,l.jsx)(d,{ref:r,className:(0,n.cx)("relative w-full rounded-xl border p-4 text-left shadow-xs","bg-white dark:bg-[#090E1A]","border-gray-200 dark:border-gray-900",s),"tremor-id":"tremor-raw",...i})});i.displayName="Card"},4508:function(e,r,s){"use strict";s.d(r,{Du:function(){return n},cx:function(){return a},kN:function(){return i},qo:function(){return d}});var l=s(1994),t=s(3335);function a(){for(var e=arguments.length,r=Array(e),s=0;s<e;s++)r[s]=arguments[s];return(0,t.m6)((0,l.Z)(...r))}let n=["focus:ring-2","focus:ring-blue-200 dark:focus:ring-blue-700/30","focus:border-blue-500 dark:focus:border-blue-700"],i=["outline outline-offset-2 outline-0 focus-visible:outline-2","outline-blue-500 dark:outline-blue-500"],d=["ring-2","border-red-500 dark:border-red-700","ring-red-200 dark:ring-red-700/30"]},5008:function(e,r,s){"use strict";let l=s(3464).Z.create({baseURL:"https://api.fleuragift.com/api"});l.interceptors.request.use(e=>{let r=localStorage.getItem("access_token");return r&&(e.headers.Authorization="Bearer ".concat(r)),e}),r.Z=l}},function(e){e.O(0,[301,317,145,971,117,744],function(){return e(e.s=2434)}),_N_E=e.O()}]);