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>
28 lines
697 B
JavaScript
28 lines
697 B
JavaScript
import Link from "./Link";
|
|
import Share from "./Share";
|
|
import Title from "./Title";
|
|
import AboutDcotor from "./cards/AboutDcotor";
|
|
import Comments from "./cards/comments";
|
|
import Locations from "./cards/locations";
|
|
|
|
function DetailDoctor({ doctor, comments, rateAggregate }) {
|
|
return (
|
|
<div className="w-full lg:w-[59%]">
|
|
<div className="hidden lg:flex">
|
|
<Share data={doctor} />
|
|
</div>
|
|
<Title doctor={doctor} />
|
|
<Link />
|
|
<AboutDcotor doctor={doctor} />
|
|
<Locations doctor={doctor} />
|
|
<Comments
|
|
doctor={doctor}
|
|
comments={comments}
|
|
rateAggregate={rateAggregate}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default DetailDoctor;
|