-
Notifications
You must be signed in to change notification settings - Fork 1k
Refactor PrintTable and PrescriptionPreview components for improved c… #15250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
abhimanyurajeesh
wants to merge
3
commits into
develop
Choose a base branch
from
manyu/print/phar
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+76
−21
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -44,7 +44,7 @@ const PrescriptionContent = ({ prescription }: PrescriptionContentProps) => { | |||||||||
| return ( | ||||||||||
| <div> | ||||||||||
| {/* Prescription Symbol */} | ||||||||||
| <div className="text-2xl font-semibold mb-3 flex items-end gap-4"> | ||||||||||
| <div className="text-xl font-semibold mb-3 flex items-end gap-4"> | ||||||||||
| <p>{t("℞")}</p> | ||||||||||
| <p className="text-sm text-gray-600 font-semibold "> | ||||||||||
| {formatDateTime( | ||||||||||
|
|
@@ -87,6 +87,13 @@ const PrescriptionContent = ({ prescription }: PrescriptionContentProps) => { | |||||||||
| instructions: `${remarks || "-"}${notes ? ` (${t("note")}: ${notes})` : ""}`, | ||||||||||
| }; | ||||||||||
| })} | ||||||||||
| className="text-xs whitespace-break-spaces text-gray-950" | ||||||||||
| cellConfig={{ | ||||||||||
| medicine: { className: "text-left font-semibold" }, | ||||||||||
| instructions: { className: "text-[10px] font-normal" }, | ||||||||||
| frequency: { className: "text-[10px] font-normal" }, | ||||||||||
| duration: { className: "text-[10px] font-normal" }, | ||||||||||
| }} | ||||||||||
| /> | ||||||||||
| </div> | ||||||||||
| )} | ||||||||||
|
|
@@ -123,13 +130,20 @@ const PrescriptionContent = ({ prescription }: PrescriptionContentProps) => { | |||||||||
| instructions: `${remarks || "-"}${notes ? ` (${t("note")}: ${notes})` : ""}`, | ||||||||||
| }; | ||||||||||
| })} | ||||||||||
| className="text-xs whitespace-break-spaces text-gray-950" | ||||||||||
| cellConfig={{ | ||||||||||
| medicine: { className: "text-left font-semibold" }, | ||||||||||
| instructions: { className: "text-[10px] font-normal" }, | ||||||||||
| frequency: { className: "text-[10px] font-normal" }, | ||||||||||
| duration: { className: "text-[10px] font-normal" }, | ||||||||||
| }} | ||||||||||
| /> | ||||||||||
| </div> | ||||||||||
| )} | ||||||||||
| {/* Doctor's Signature */} | ||||||||||
| <div className="w-full items-end mt-6 flex flex-row justify-end gap-1"> | ||||||||||
| <div className="text-right"> | ||||||||||
| <p className="text-sm text-gray-400">{t("prescribed_by")}</p> | ||||||||||
| <p className="text-xs text-gray-400">{t("prescribed_by")}</p> | ||||||||||
| <p className="text-sm text-gray-600 font-semibold"> | ||||||||||
| {formatName( | ||||||||||
| prescription.prescription?.prescribed_by || | ||||||||||
|
|
@@ -187,12 +201,12 @@ export const PrescriptionPreview = ({ | |||||||||
| <div className="flex justify-between items-start mb-4 pb-2 border-b border-gray-200"> | ||||||||||
| <div className="flex items-start gap-4"> | ||||||||||
| <div className="text-left"> | ||||||||||
| <h1 className="text-2xl font-medium">{facility?.name}</h1> | ||||||||||
| <h1 className="text-xl font-medium">{facility?.name}</h1> | ||||||||||
| {facility?.address && ( | ||||||||||
| <div className="text-gray-500 whitespace-pre-wrap wrap-break-word text-sm"> | ||||||||||
| <div className="text-gray-500 whitespace-pre-wrap wrap-break-word text-xs"> | ||||||||||
| {facility.address} | ||||||||||
| {facility.phone_number && ( | ||||||||||
| <p className="text-gray-500 text-sm"> | ||||||||||
| <p className="text-gray-500 text-xs"> | ||||||||||
| {t("phone")}: {facility.phone_number} | ||||||||||
| </p> | ||||||||||
abhimanyurajeesh marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| )} | ||||||||||
|
|
@@ -240,11 +254,8 @@ export const PrescriptionPreview = ({ | |||||||||
| label={t("date")} | ||||||||||
| value={ | ||||||||||
| encounter?.period?.start | ||||||||||
| ? format( | ||||||||||
| new Date(encounter.period.start), | ||||||||||
| "dd MMM yyyy, EEEE", | ||||||||||
| ) | ||||||||||
| : format(new Date(), "dd MMM yyyy, EEEE") | ||||||||||
| ? format(new Date(encounter.period.start), "dd/mm/yy") | ||||||||||
| : format(new Date(), "dd/mm/yy") | ||||||||||
|
||||||||||
| ? format(new Date(encounter.period.start), "dd/mm/yy") | |
| : format(new Date(), "dd/mm/yy") | |
| ? format(new Date(encounter.period.start), "dd/MM/yy") | |
| : format(new Date(), "dd/MM/yy") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HeaderRow.className is never applied to header cells.
HeaderRow.classNameis added but not used in<TableHead>, so per-header styling won’t take effect.🛠️ Proposed fix
Also applies to: 75-81
🤖 Prompt for AI Agents