From 2eff08bf86c15835147b7b7de31ed79711a65743 Mon Sep 17 00:00:00 2001 From: Joao Correia Date: Sat, 25 Jan 2025 04:23:28 +0000 Subject: [PATCH] Add approval by to step details panel and add text size prop to UserWithProfilePicture component --- .../ApprovalWorkflows/UserWithProfilePic.tsx | 6 +++-- src/pages/approval-workflows/[id].tsx | 25 ++++++++++++++++--- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/components/ApprovalWorkflows/UserWithProfilePic.tsx b/src/components/ApprovalWorkflows/UserWithProfilePic.tsx index 4254bfd9..34c78adb 100644 --- a/src/components/ApprovalWorkflows/UserWithProfilePic.tsx +++ b/src/components/ApprovalWorkflows/UserWithProfilePic.tsx @@ -4,12 +4,14 @@ interface Props { prefix: string; name: string; profileImage: string; + textSize?: string; } -export default function UserWithProfilePic({ prefix, name, profileImage }: Props) { +export default function UserWithProfilePic({ prefix, name, profileImage, textSize }: Props) { + const textClassName = `${textSize ? textSize : "text-xs"} font-medium` return (
-

{prefix} {name}

+

{prefix} {name}

{name} {selectedStep.completed ? ( -
+
Approved on {new Date(selectedStep.completedDate!).toLocaleString("en-CA", { year: "numeric", month: "2-digit", @@ -190,9 +190,27 @@ export default function Home({ user, workflow, workflowAssignees, workflowReques second: "2-digit", hour12: false, }).replace(", ", " at ")} -

No additional actions are required.

+
+

Approved by:

+ {(() => { + const assignee = workflowAssignees.find( + (assignee) => assignee.id === selectedStep.completedBy + ); + return assignee ? ( + + ) : ( + "Unknown" + ); + })()} +
+

No additional actions are required.

- + ) : (
One assignee is required to sign off to complete this step: @@ -200,6 +218,7 @@ export default function Home({ user, workflow, workflowAssignees, workflowReques {workflowAssignees.map(user => (