diff --git a/src/components/customerCases/customerCase/CustomerCase.tsx b/src/components/customerCases/customerCase/CustomerCase.tsx index 5a495d81..755f43a3 100644 --- a/src/components/customerCases/customerCase/CustomerCase.tsx +++ b/src/components/customerCases/customerCase/CustomerCase.tsx @@ -19,9 +19,14 @@ export default async function CustomerCase({ customerCase, customerCasesPagePath, }: CustomerCaseProps) { - const consultantsResult = await fetchEmployeesByEmails( - customerCase.projectInfo.consultants.map((e) => e.employeeEmail), - ); + let consultantsResult; + + if (customerCase.projectInfo.consultants) { + const consultantsEmail = customerCase.projectInfo.consultants.map( + (e) => e.employeeEmail, + ); + consultantsResult = await fetchEmployeesByEmails(consultantsEmail); + } return (
@@ -32,14 +37,12 @@ export default async function CustomerCase({ color={customerCase.clientColors.color} />
- {consultantsResult.ok && ( -
- -
- )} +
+ +
@@ -48,7 +51,7 @@ export default async function CustomerCase({ ))}
- {consultantsResult.ok && ( + {consultantsResult?.ok && ( n.employeeFirstName, - ); + let consultantsFirstNames; + + if (projectInfo.consultants) { + consultantsFirstNames = projectInfo.consultants.map( + (n) => n.employeeFirstName, + ); + } return ( - <> -
-
- {projectInfo.customerSectors && ( +
+
+ {projectInfo.customerSectors && ( +
+ + {t("customer").toUpperCase()} + +
+ {projectInfo.customerSectors.map((sector: CustomerSector) => ( + + {sector.customerSector} + + ))} +
+
+ )} + {consultantsFirstNames && ( +
+ + {t("variants").toUpperCase()} + +
+ + {consultantsFirstNames.map((name) => ( + + {name} + + ))} + +
+
+ )} + {projectInfo.collaborators && ( +
+ + {t("collaborators").toUpperCase()} + +
+ {projectInfo.collaborators.map((collaborator) => ( + + {collaborator} + + ))} +
+
+ )} + {projectInfo.url && ( +
+ + {t("url")} + + +
+ )} +
+ {projectInfo.deliveries && ( +
+ {projectInfo.deliveries["projectManagement"] && (
- {t("customer").toUpperCase()} + {t("project_management").toUpperCase()} -
- {projectInfo.customerSectors.map((sector: CustomerSector) => ( - - {sector.customerSector} - - ))} +
+ {projectInfo.deliveries["projectManagement"].map( + (projectManagement) => ( + + {projectManagement.projectManagementDelivery} + + ), + )}
)} - {consultantsFirstNames && ( + {projectInfo.deliveries["design"] && (
- {t("variants").toUpperCase()} + {t("design").toUpperCase()} -
- - {consultantsFirstNames.map((name) => ( +
+ {projectInfo.deliveries["design"].map((design) => ( - {name} + {design.designDelivery} ))} -
)} - {projectInfo.collaborators && ( + {projectInfo.deliveries["development"] && (
- {t("collaborators").toUpperCase()} + {t("development").toUpperCase()}
- {projectInfo.collaborators.map((collaborator) => ( + {projectInfo.deliveries["development"].map((development) => ( - {collaborator} + {development.developmentDelivery} ))}
)} - {projectInfo.url && ( -
- - {t("url")} - - -
- )}
-
- {projectInfo.deliveries && ( -
- {projectInfo.deliveries["projectManagement"] && ( -
- - {t("project_management").toUpperCase()} - -
- {projectInfo.deliveries["projectManagement"].map( - (projectManagement) => ( - - {projectManagement.projectManagementDelivery} - - ), - )} -
-
- )} - {projectInfo.deliveries["design"] && ( -
- - {t("design").toUpperCase()} - -
- {projectInfo.deliveries["design"].map((design) => ( - - {design.designDelivery} - - ))} -
-
- )} - {projectInfo.deliveries["development"] && ( -
- - {t("development").toUpperCase()} - -
- {projectInfo.deliveries["development"].map( - (development) => ( - - {development.developmentDelivery} - - ), - )} -
-
- )} -
- )} -
-
- + )} +
); } diff --git a/src/components/customerCases/customerCase/projectInfo/customerCaseProjectInfo.module.css b/src/components/customerCases/customerCase/projectInfo/customerCaseProjectInfo.module.css index 031cb610..e8f5b85d 100644 --- a/src/components/customerCases/customerCase/projectInfo/customerCaseProjectInfo.module.css +++ b/src/components/customerCases/customerCase/projectInfo/customerCaseProjectInfo.module.css @@ -3,6 +3,7 @@ flex-direction: row; gap: 1rem; width: 100%; + max-width: 960px; @media (max-width: 425px) { flex-direction: column; @@ -14,7 +15,7 @@ gap: 1.5rem; display: flex; flex-direction: column; - max-width: 50%; + width: 50%; } .badgeWrapper { @@ -69,6 +70,7 @@ flex-direction: column; gap: 1.5rem; flex-wrap: wrap; + width: 50%; } .preFancyCharacter {