Connect the existing doctor-page review UI to the rebuilt backend contract
(see clinicpro feat/rating-multidimensional).
- page.js fetches the rating aggregate alongside comments and passes
rateAggregate down to the chart (point / satisfaction / 5 dimensions).
- Submit form sends the five dimensions with doctor_uuid; comment/reply
send {doctor_uuid, comment, parent}; 401/403 ERR_RATING_NOT_ELIGIBLE
surface friendly guidance.
- Like/dislike call POST /like/{uuid} with value and update from the
response; replies render nested.
- ModalAnswer gates the submit button on GET /rate/{uuid}/eligibility.
- services/response.js: getRateEligibility, postCommentsLike(uuid, value),
drop unused patchDoctorRate. Fix hardcoded modal title; empty-state for
no comments. Remove orphaned AnswerField.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
38 lines
1.3 KiB
JavaScript
38 lines
1.3 KiB
JavaScript
import AppointmentList from "./appointmentList";
|
|
import DetailDoctor from "./detailDoctor";
|
|
import Share from "./detailDoctor/Share";
|
|
import CustomLoading from "@/app/component/loading/Custom";
|
|
|
|
function DoctorPage({ doctor, comments, rateAggregate, slug }) {
|
|
return (
|
|
<div className="pt-[92px] sm:pt-[120px] mt:pt-[148px] lg:pt-[176px] mt-[px] padding-responsive">
|
|
<div className="flex items-center justify-between">
|
|
<CustomLoading width={180} height={25}>
|
|
<div className="flex items-center justify-start text-[14px] md:text-[16px] font-normal">
|
|
<h2 className="text-[#9B9B9B] text-nowrap">
|
|
{doctor?.specialties?.map(
|
|
(item, idx) =>
|
|
`${item.name} ${doctor.specialties.length === idx + 1 ? ">" : "|"} `
|
|
)}
|
|
</h2>
|
|
<p className="text-[#525252] text-nowrap mr-1">{doctor?.name}</p>
|
|
</div>
|
|
</CustomLoading>
|
|
<div className="flex lg:hidden">
|
|
<Share data={doctor} />
|
|
</div>
|
|
</div>
|
|
<div className="flex items-start justify-center gap-6 mt-[30px]">
|
|
<DetailDoctor
|
|
doctor={doctor}
|
|
comments={comments}
|
|
rateAggregate={rateAggregate}
|
|
/>
|
|
<AppointmentList doctor={doctor} doctorSlug={slug} />
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default DoctorPage;
|