Skip to content

Commit

Permalink
[fix] update project name in modal
Browse files Browse the repository at this point in the history
  • Loading branch information
jojortz committed Aug 20, 2024
1 parent e4d0dbf commit 7d62c84
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ const SustainabilityReportAddFileModal = () => {
SustainabilityReportAddFileModal.onClose();
};

const getProjectName = () => {
const projectIds = projects.filter((project) => project.id === SustainabilityReportAddFileModal.projectId);
if (projectIds[0]) return projectIds[0].name;
return '';
};

const bodyContent = (
<div className="flex flex-col gap-4">
<Heading
title={`Add Files to ${projects.filter((project) => project.id === SustainabilityReportAddFileModal.projectId)[0].name}`}
subtitle=""
center
/>
<Heading title={`Add Files to ${getProjectName()}`} subtitle="" center />
{SustainabilityReportAddFileModal.addFileModalState === AddFileModalState.ADD_FILES && (
<>
<Dropzone />
Expand Down

0 comments on commit 7d62c84

Please sign in to comment.