diff --git a/frontend/src/components/pages/search/components/ResultCard/ResultCardCarousel/ResultCardCarousel.tsx b/frontend/src/components/pages/search/components/ResultCard/ResultCardCarousel/ResultCardCarousel.tsx index b1ff00597..7f15b8211 100644 --- a/frontend/src/components/pages/search/components/ResultCard/ResultCardCarousel/ResultCardCarousel.tsx +++ b/frontend/src/components/pages/search/components/ResultCard/ResultCardCarousel/ResultCardCarousel.tsx @@ -1,7 +1,9 @@ import { CardIcon } from 'components/CardIcon'; import { SmallCarousel } from 'components/Carousel'; import { ImageWithLegend } from 'components/ImageWithLegend'; +import useHasMounted from 'hooks/useHasMounted'; import { ContentType, ImageFromAttachment } from 'modules/interface'; +import { cn } from 'services/utils/cn'; interface ResultCardCarouselProps { type: ContentType; @@ -23,13 +25,12 @@ export const ResultCardCarousel: React.FC = ({ redirect, asColumn, }) => { - const files = typeof navigator !== 'undefined' && navigator?.onLine ? images : images.slice(0, 1); + const hasNavigator = useHasMounted(typeof navigator !== 'undefined' && navigator.onLine); + const files = hasNavigator ? images : images.slice(0, 1); return (
{files.map((image, index) => (