@@ -2,15 +2,15 @@ import React, { FC } from "react";
22import { Autoplay , Parallax } from "swiper" ;
33import { Swiper , SwiperSlide } from "swiper/react" ;
44import { styled } from "styled-components" ;
5- import { Color } from "../../ styles/colors" ;
5+ import { Color } from "@ styles/colors" ;
66import "swiper/swiper-bundle.min.css" ;
77import "../../components/Swiper/SpeakersCarousel.scss" ;
8- import conferenceData from "../../data/2025.json " ;
9- import { useFetchSpeakers } from "../../hooks/useFetchSpeakers" ;
10- import { ISpeaker } from "../../ types/speakers" ;
11- import { ROUTE_SPEAKER_DETAIL } from "../../ constants/routes" ;
8+ import { useFetchSpeakers } from "@hooks/useFetchSpeakers " ;
9+ // @ts -expect-error some weird error when importing types
10+ import { ISpeaker } from "@ types/speakers" ;
11+ import { ROUTE_SPEAKER_DETAIL } from "@ constants/routes" ;
1212import { Link } from "react-router" ;
13- import { useSentryErrorReport } from "../../ hooks/useSentryErrorReport" ;
13+ import { useSentryErrorReport } from "@ hooks/useSentryErrorReport" ;
1414
1515const StyledSlideImage = styled . img `
1616 display: block;
@@ -36,8 +36,17 @@ const StyledSlideText = styled.p`
3636 font-size: 0.875rem;
3737 color: white;
3838` ;
39- const SpeakerSwiper : FC < React . PropsWithChildren < unknown > > = ( ) => {
40- const { isLoading, data, error } = useFetchSpeakers ( ) ;
39+
40+ interface Props {
41+ isEnabled : boolean ;
42+ url : string ;
43+ }
44+
45+ const SpeakerSwiper : FC < React . PropsWithChildren < Props > > = ( {
46+ isEnabled,
47+ url,
48+ } ) => {
49+ const { isLoading, data, error } = useFetchSpeakers ( url ) ;
4150
4251 const cachedSpeakers = React . useMemo ( ( ) => {
4352 return data ?. toSorted ( ( ) => 0.5 - Math . random ( ) ) . slice ( 0 , 20 ) ;
@@ -48,7 +57,7 @@ const SpeakerSwiper: FC<React.PropsWithChildren<unknown>> = () => {
4857 return (
4958 < >
5059 { isLoading && < p > Loading</ p > }
51- { conferenceData . carrousel . enabled && cachedSpeakers && (
60+ { isEnabled && cachedSpeakers && (
5261 < Swiper
5362 autoplay = { {
5463 delay : 500 ,
0 commit comments