From b85b812981b75d3ddad1655fad42960e92d47f6e Mon Sep 17 00:00:00 2001 From: Vikas Nale Date: Wed, 6 Aug 2025 17:07:22 +0530 Subject: [PATCH] Handle null variable --- src/components/Employee/EmpBanner.jsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/Employee/EmpBanner.jsx b/src/components/Employee/EmpBanner.jsx index 756a7c56..7b022d09 100644 --- a/src/components/Employee/EmpBanner.jsx +++ b/src/components/Employee/EmpBanner.jsx @@ -44,7 +44,19 @@ const EmpBanner = ({ profile, loggedInUser }) => {
-

{`${profile?.firstName} ${profile?.middleName} ${profile?.lastName}`}

+

+ {profile?.firstName} + {profile?.middleName ? ( + {profile?.middleName} + ) : ( + <> + )} + {profile?.lastName ? ( + {profile?.lastName} + ) : ( + <> + )} +