feat(doctor profile): implement unclaimed doctor handling and UI adjustments
This commit is contained in:
@@ -5,6 +5,10 @@ import Comment from "@/app/component/comment";
|
||||
import ModalAnswer from "./modal/ModalAnswer";
|
||||
|
||||
function Comments({ doctor, comments, rateAggregate }) {
|
||||
const isUnclaimed = doctor?.owner_status !== "claimed";
|
||||
const hasComments = comments?.length > 0;
|
||||
const hideRatingBlock = isUnclaimed && !hasComments;
|
||||
|
||||
return (
|
||||
<div className="mt-[24px] sm:mt-[27px] md:mt-[29px] lg:mt-[32px]">
|
||||
<a
|
||||
@@ -20,8 +24,16 @@ function Comments({ doctor, comments, rateAggregate }) {
|
||||
</p>
|
||||
<ModalAnswer doctor={doctor} />
|
||||
</div>
|
||||
<Chart comments={comments} rateAggregate={rateAggregate} />
|
||||
<Comment comments={comments} doctor={doctor} />
|
||||
{hideRatingBlock ? (
|
||||
<p className="mt-[16px] text-[#616161] text-[14px] md:text-[16px] font-normal">
|
||||
هنوز نظری برای این پزشک ثبت نشده است.
|
||||
</p>
|
||||
) : (
|
||||
<>
|
||||
<Chart comments={comments} rateAggregate={rateAggregate} />
|
||||
<Comment comments={comments} doctor={doctor} />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user