2 lines
5.8 KiB
JavaScript
2 lines
5.8 KiB
JavaScript
import{a as q,b0 as z,c as E,d as G,r as v,e as K,f as s,F as R,S as f,j as h,B as U,bK as Y,t as b,T as W,o as $,ap as J,aT as O,Y as Q,C as X}from"./index.eaf14aef.js";import{P as Z}from"./Page.c2cde06d.js";import{C as j}from"./Card.4687a3ba.js";import{G as g}from"./Grid.dda358cb.js";import{C as H}from"./Chip.35ff2c8a.js";import{H as o}from"./HeaderBreadcrumbs.91259cd4.js";b(W)(({theme:d})=>({...d.typography.subtitle2,color:d.palette.text.secondary,marginBottom:d.spacing(1)}));const N=b("header")(({theme:d})=>({paddingBottom:d.spacing(5),display:"flex",alignItems:"center",justifyContent:"space-between"})),V=b(W)(({theme:d})=>({...d.typography.h4,boxShadow:"none",fontWeight:700,color:"#005B7F"})),l=b(W)(({theme:d})=>({boxShadow:"none",paddingBottom:d.spacing(1)})),y=b(W)(({theme:d})=>({boxShadow:"none",paddingBottom:d.spacing(3)}));function c({isEdit:d,currentAppointment:a}){var w,C,B,T,k,P,F,D,I,L;q(),z();const _=E().shape({name:G().required("Name is required")}),x=v.exports.useMemo(()=>({id:a==null?void 0:a.id,name:(a==null?void 0:a.name)||"",address:(a==null?void 0:a.address)||"",birth_date:(a==null?void 0:a.birth_date)||"",gender:(a==null?void 0:a.gender)||"",description:(a==null?void 0:a.description)||"",birth_place:(a==null?void 0:a.birth_place)||"",active:(a==null?void 0:a.active)===1,avatar_url:(a==null?void 0:a.avatar_url)||"",doctor_id:(a==null?void 0:a.doctor_id)||"",organizations:(a==null?void 0:a.organizations)||[],specialities:(a==null?void 0:a.specialities)||[]}),[a]),i=K({resolver:$(_),defaultValues:x}),{reset:S,watch:M,control:e,setValue:m,getValues:u,setError:r,handleSubmit:A,formState:{isSubmitting:p}}=i;return M(),v.exports.useEffect(()=>{d&&a&&S(x),d||S(x)},[d,a]),s(R,{methods:i,children:s(f,{spacing:3,children:h(U,{sx:{width:"100%"},children:[h(j,{sx:{p:5},children:[s(N,{children:s(g,{item:!0,xs:6,md:6,children:s(f,{direction:"row",divider:s(Y,{orientation:"vertical",flexItem:!0}),spacing:2,children:s(V,{children:"Data Live Chat"})})})}),h(g,{container:!0,rowSpacing:1,columnSpacing:{xs:1,sm:2,md:3},children:[s(g,{item:!0,xs:12,children:h(f,{direction:"row",spacing:2,children:[s(g,{item:!0,xs:6,children:h(f,{direction:"row",spacing:2,alignItems:"center",children:[s(l,{style:{fontWeight:"bold",paddingBottom:"0px"},children:"Status Appointment :"}),s(H,{label:a!=null&&a.status_appointment?a==null?void 0:a.status_appointment:"-",variant:"outlined"})]})}),s(g,{item:!0,xs:6,children:h(f,{direction:"row",spacing:2,alignItems:"center",children:[s(l,{style:{fontWeight:"bold",paddingBottom:"0px"},children:"Status Chat :"}),s(H,{label:a!=null&&a.status_chat?a==null?void 0:a.status_chat:"-",variant:"outlined"})]})})]})}),s(g,{item:!0,xs:12,sx:{marginTop:"20px"},children:h(f,{direction:"row",spacing:2,children:[s(g,{item:!0,xs:6,children:h(f,{direction:"row",spacing:2,children:[s(l,{style:{fontWeight:"bold"},children:"Tanggal Booking :"}),s(y,{children:a!=null&&a.date_created?a==null?void 0:a.date_created:"-"})]})}),s(g,{item:!0,xs:6,children:h(f,{direction:"row",spacing:2,children:[s(l,{style:{fontWeight:"bold"},children:"Tanggal Appointment :"}),s(y,{children:a!=null&&a.date_appointment?a==null?void 0:a.date_appointment:"-"})]})})]})}),h(g,{item:!0,xs:6,children:[s(l,{style:{fontWeight:"bold"},children:"Nama Dokter"}),s(y,{children:a!=null&&a.doctor_name?a==null?void 0:a.doctor_name:"-"}),s(l,{style:{fontWeight:"bold"},children:"Faskes"}),s(y,{children:a!=null&&a.health_care?a==null?void 0:a.health_care:"-"}),s(l,{style:{fontWeight:"bold"},children:"Durasi"}),s(y,{children:a!=null&&a.duration?a==null?void 0:a.duration:"-"})]}),h(g,{item:!0,xs:6,columnSpacing:{xs:1,sm:2,md:3},children:[s(l,{style:{fontWeight:"bold"},children:"Spesialis"}),s(y,{children:a!=null&&a.speciality?a==null?void 0:a.speciality:"-"}),s(l,{style:{fontWeight:"bold"},children:"Appointment Via Web/App"}),s(y,{children:a!=null&&a.appointment_media?a==null?void 0:a.appointment_media:"-"})]})]})]}),h(j,{sx:{mt:5,p:5},children:[s(N,{children:s(g,{item:!0,xs:6,md:6,children:s(V,{children:"Data Pembayaran"})})}),(a==null?void 0:a.payment_detail)!==null?h(g,{container:!0,rowSpacing:1,columnSpacing:{xs:1,sm:2,md:3},children:[h(g,{item:!0,xs:6,children:[s(l,{style:{fontWeight:"bold"},children:"Metode Pembayaran"}),s(y,{children:a!=null&&a.payment_method?a==null?void 0:a.payment_method:"-"}),s(l,{style:{fontWeight:"bold"},children:"Harga"}),s(y,{children:(w=a==null?void 0:a.payment_detail)!=null&&w.gross_amount?(C=a==null?void 0:a.payment_detail)==null?void 0:C.gross_amount:"-"}),s(l,{style:{fontWeight:"bold"},children:"Mata Uang"}),s(y,{children:(B=a==null?void 0:a.payment_detail)!=null&&B.currency?(T=a==null?void 0:a.payment_detail)==null?void 0:T.currency:"-"})]}),h(g,{item:!0,xs:6,columnSpacing:{xs:1,sm:2,md:3},children:[s(l,{style:{fontWeight:"bold"},children:"Tipe Pembayaran"}),s(y,{children:(k=a==null?void 0:a.payment_detail)!=null&&k.payment_type?(P=a==null?void 0:a.payment_detail)==null?void 0:P.payment_type:"-"}),s(l,{style:{fontWeight:"bold"},children:"Waktu Transaksi"}),s(y,{children:(F=a==null?void 0:a.payment_detail)!=null&&F.transaction_time?(D=a==null?void 0:a.payment_detail)==null?void 0:D.transaction_time:"-"}),s(l,{style:{fontWeight:"bold"},children:"Status"}),s(y,{children:(I=a==null?void 0:a.payment_detail)!=null&&I.status_message?(L=a==null?void 0:a.payment_detail)==null?void 0:L.status_message:"-"})]})]}):s(l,{children:"Belum ada pembayaran"})]})]})})})}function ha(){const{themeStretch:d}=J(),{id:a}=O(),_=!!a,[x,i]=v.exports.useState();return v.exports.useEffect(()=>{_&&Q.get("/live-chat/"+a).then(S=>{i(S.data)})},[a]),s(Z,{title:"Live Chat",children:h(X,{maxWidth:d?!1:"xl",children:[s(f,{direction:"row",alignItems:"center",children:s(o,{heading:"Live Chat",links:[{name:"Report",href:"/report"},{name:"Live Chat",href:"/report/live-chat"}]})}),s(c,{isEdit:_,currentAppointment:x})]})})}export{ha as default};
|