Skip to content

Commit 15e2e12

Browse files
committed
Hide result overview title when empty
The inspection and analysis overview sections rendered their title even when no task was successful, leaving a heading above an empty area. Skip the section entirely when there are no result cards.
1 parent 6f0ef4c commit 15e2e12

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

frontend/src/pages/InspectionReportPage/ImageOverview.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,15 @@ const ImageOverview = ({ tasks, variant }: { tasks: Task[]; variant: OverviewVar
5858
)
5959
}
6060

61-
const OverviewSection = ({ tasks, variant, title }: { tasks: Task[]; variant: OverviewVariant; title: string }) => (
62-
<StyledInspectionOverviewSection>
63-
<Typography variant="h4">{title}</Typography>
64-
<ImageOverview tasks={tasks} variant={variant} />
65-
</StyledInspectionOverviewSection>
66-
)
61+
const OverviewSection = ({ tasks, variant, title }: { tasks: Task[]; variant: OverviewVariant; title: string }) => {
62+
if (!tasks.some((task) => task.status === TaskStatus.Successful)) return <></>
63+
return (
64+
<StyledInspectionOverviewSection>
65+
<Typography variant="h4">{title}</Typography>
66+
<ImageOverview tasks={tasks} variant={variant} />
67+
</StyledInspectionOverviewSection>
68+
)
69+
}
6770

6871
const OverviewDialogView = ({ tasks, variant }: { tasks: Task[]; variant: OverviewVariant }) => (
6972
<StyledInspectionOverviewDialogView>

0 commit comments

Comments
 (0)