2 lines
5.1 KiB
JavaScript
2 lines
5.1 KiB
JavaScript
import{a as q,b0 as z,c as E,d as G,r as W,e as K,f as s,F as R,S as f,j as l,B as U,bK as Y,t as b,T as w,o as $,ap as J,aT as L,Y as O,C as Q}from"./index.eaf14aef.js";import{P as X}from"./Page.c2cde06d.js";import{C as N}from"./Card.4687a3ba.js";import{G as y}from"./Grid.dda358cb.js";import{C as Z}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 V=b("header")(({theme:d})=>({paddingBottom:d.spacing(5),display:"flex",alignItems:"center",justifyContent:"space-between"})),I=b(w)(({theme:d})=>({...d.typography.h4,boxShadow:"none",fontWeight:700,color:"#005B7F"})),h=b(w)(({theme:d})=>({boxShadow:"none",paddingBottom:d.spacing(1)})),g=b(w)(({theme:d})=>({boxShadow:"none",paddingBottom:d.spacing(3)}));function c({isEdit:d,currentAppointment:a}){var v,B,C,T,k,P,F,j,D,H;q(),z();const _=E().shape({name:G().required("Name is required")}),x=W.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:A,handleSubmit:r,formState:{isSubmitting:p}}=i;return M(),W.exports.useEffect(()=>{d&&a&&S(x),d||S(x)},[d,a]),s(R,{methods:i,children:s(f,{spacing:3,children:l(U,{sx:{width:"100%"},children:[l(N,{sx:{p:5},children:[s(V,{children:s(y,{item:!0,xs:6,md:6,children:l(f,{direction:"row",divider:s(Y,{orientation:"vertical",flexItem:!0}),spacing:2,children:[s(I,{children:"Data Appointment"}),s(Z,{label:a==null?void 0:a.status,variant:"outlined"})]})})}),l(y,{container:!0,rowSpacing:1,columnSpacing:{xs:1,sm:2,md:3},children:[s(y,{item:!0,xs:12,children:l(f,{direction:"row",spacing:2,children:[s(y,{item:!0,xs:6,children:l(f,{direction:"row",spacing:2,children:[s(h,{style:{fontWeight:"bold"},children:"Tanggal Booking :"}),s(g,{children:a!=null&&a.date_created?a==null?void 0:a.date_created:"-"})]})}),s(y,{item:!0,xs:6,children:l(f,{direction:"row",spacing:2,children:[s(h,{style:{fontWeight:"bold"},children:"Tanggal Appointment :"}),s(g,{children:a!=null&&a.date_appointment?a==null?void 0:a.date_appointment:"-"})]})})]})}),l(y,{item:!0,xs:6,children:[s(h,{style:{fontWeight:"bold"},children:"Nama Dokter"}),s(g,{children:a!=null&&a.doctor_name?a==null?void 0:a.doctor_name:"-"}),s(h,{style:{fontWeight:"bold"},children:"Faskes"}),s(g,{children:a!=null&&a.health_care?a==null?void 0:a.health_care:"-"})]}),l(y,{item:!0,xs:6,columnSpacing:{xs:1,sm:2,md:3},children:[s(h,{style:{fontWeight:"bold"},children:"Spesialis"}),s(g,{children:a!=null&&a.speciality?a==null?void 0:a.speciality:"-"}),s(h,{style:{fontWeight:"bold"},children:"Appointment Via Web/App"}),s(g,{children:a!=null&&a.appointment_media?a==null?void 0:a.appointment_media:"-"})]})]})]}),l(N,{sx:{mt:5,p:5},children:[s(V,{children:s(y,{item:!0,xs:6,md:6,children:s(I,{children:"Data Pembayaran"})})}),(a==null?void 0:a.payment_detail)!==null?l(y,{container:!0,rowSpacing:1,columnSpacing:{xs:1,sm:2,md:3},children:[l(y,{item:!0,xs:6,children:[s(h,{style:{fontWeight:"bold"},children:"Metode Pembayaran"}),s(g,{children:a!=null&&a.payment_method?a==null?void 0:a.payment_method:"-"}),s(h,{style:{fontWeight:"bold"},children:"Harga"}),s(g,{children:(v=a==null?void 0:a.payment_detail)!=null&&v.gross_amount?(B=a==null?void 0:a.payment_detail)==null?void 0:B.gross_amount:"-"}),s(h,{style:{fontWeight:"bold"},children:"Mata Uang"}),s(g,{children:(C=a==null?void 0:a.payment_detail)!=null&&C.currency?(T=a==null?void 0:a.payment_detail)==null?void 0:T.currency:"-"})]}),l(y,{item:!0,xs:6,columnSpacing:{xs:1,sm:2,md:3},children:[s(h,{style:{fontWeight:"bold"},children:"Tipe Pembayaran"}),s(g,{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(h,{style:{fontWeight:"bold"},children:"Waktu Transaksi"}),s(g,{children:(F=a==null?void 0:a.payment_detail)!=null&&F.transaction_time?(j=a==null?void 0:a.payment_detail)==null?void 0:j.transaction_time:"-"}),s(h,{style:{fontWeight:"bold"},children:"Status"}),s(g,{children:(D=a==null?void 0:a.payment_detail)!=null&&D.status_message?(H=a==null?void 0:a.payment_detail)==null?void 0:H.status_message:"-"})]})]}):s(h,{children:"Belum ada pembayaran"})]})]})})})}function ha(){const{themeStretch:d}=J(),{id:a}=L(),_=!!a,[x,i]=W.exports.useState();return W.exports.useEffect(()=>{_&&O.get("/appointments/"+a).then(S=>{i(S.data)})},[a]),s(X,{title:"Appointment",children:l(Q,{maxWidth:d?!1:"xl",children:[s(f,{direction:"row",alignItems:"center",children:s(o,{heading:"Appointment",links:[{name:"Report",href:"/report"},{name:"Appointments",href:"/report/appointments"}]})}),s(c,{isEdit:_,currentAppointment:x})]})})}export{ha as default};
|