Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
UdaySagar-Git committed Jul 12, 2024
1 parent cdfdf8f commit f6c39b3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
7 changes: 4 additions & 3 deletions src/Components/Facility/DoctorNoteReplyPreviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ const DoctorNoteReplyPreviewCard = ({
children,
cancelReply,
}: Props) => {
return parentNote ? (
if (!parentNote) {
return children;
}
return (
<div className="mt-3 flex flex-col rounded-lg border border-gray-300 bg-gray-200 pt-2 text-gray-800">
<div className="flex flex-col">
<div className="flex justify-between pl-3">
Expand Down Expand Up @@ -64,8 +67,6 @@ const DoctorNoteReplyPreviewCard = ({
</div>
<div>{children}</div>
</div>
) : (
<div>{children}</div>
);
};

Expand Down
35 changes: 17 additions & 18 deletions src/Components/Facility/PatientNoteCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,27 +290,26 @@ const PatientNoteCard = ({
>
<MarkdownPreview markdown={noteField} />
<div className="flex gap-2">
{note.files &&
note.files.length > 0 &&
note.files.map((file: any) => (
{/* temporaryly marked as any due to external_id */}
{note?.files?.map((file: any) => (
<div
key={file.id}
className="relative mt-1 h-20 w-20 cursor-pointer rounded-md bg-gray-100 shadow-sm hover:bg-gray-200"
>
<div
key={file.id}
className="relative mt-1 h-20 w-20 cursor-pointer rounded-md bg-gray-100 shadow-sm hover:bg-gray-200"
className="flex h-full w-full flex-col items-center justify-center p-2"
onClick={() => loadFile(file.external_id, note.id)}
>
<div
className="flex h-full w-full flex-col items-center justify-center p-2"
onClick={() => loadFile(file.external_id, note.id)}
>
<CareIcon
icon="l-file"
className="shrink-0 text-2xl text-gray-600"
/>
<span className="mt-1 max-h-[2.5em] w-full overflow-hidden text-ellipsis break-words text-center text-xs text-gray-600">
{file.name}
</span>
</div>
<CareIcon
icon="l-file"
className="shrink-0 text-2xl text-gray-600"
/>
<span className="mt-1 max-h-[2.5em] w-full overflow-hidden text-ellipsis break-words text-center text-xs text-gray-600">
{file.name}
</span>
</div>
))}
</div>
))}
</div>
{mode == "thread-view" && note.replies.length > 0 && (
<div className="mt-2 flex items-center text-xs text-gray-500">
Expand Down

0 comments on commit f6c39b3

Please sign in to comment.