diff --git a/src/components/sidebar/defibrillatorDetails.tsx b/src/components/sidebar/defibrillatorDetails.tsx index 468db0a..ff266e6 100644 --- a/src/components/sidebar/defibrillatorDetails.tsx +++ b/src/components/sidebar/defibrillatorDetails.tsx @@ -32,7 +32,11 @@ import DetailTextRow from "./detailTextRow"; import { OpeningHoursField } from "./openingHours"; import { CheckDateField } from "./verificationDate"; -function photoGallery(data: DefibrillatorData, closeSidebar: () => void) { +const PhotoGallery: FC = ({ + data, + closeSidebar, +}) => { + if (data === null) return null; const { t } = useTranslation(); const { authState: { auth }, @@ -112,7 +116,7 @@ function photoGallery(data: DefibrillatorData, closeSidebar: () => void) {
); -} +}; const DefibrillatorDetails: FC = (props) => { const { t } = useTranslation(); @@ -158,7 +162,7 @@ const DefibrillatorDetails: FC = (props) => { - {photoGallery(data, closeSidebar)} +