import React from 'react' import { Box, IconButton, useBreakpointValue, Stack, Heading, Text, Container, } from '@chakra-ui/react' // Here we have used react-icons package for the icons import { BiLeftArrowAlt, BiRightArrowAlt } from 'react-icons/bi' // And react-slick as our Carousel Lib import Slider from 'react-slick' import newsJson from '../../../static_data/news.json' import { useRouter } from 'next/router' // Settings for the slider const settings = { dots: true, arrows: false, fade: true, infinite: true, autoplay: true, speed: 500, autoplaySpeed: 15000, slidesToShow: 1, slidesToScroll: 1, } export default function NewsSlider() { // As we have used custom buttons, we need a reference variable to // change the state const [slider, setSlider] = React.useState(null) // These are the breakpoints which changes the position of the // buttons as the screen size changes const top = useBreakpointValue({ base: '90%', md: '50%' }) const side = useBreakpointValue({ base: '30%', md: '40px' }) const { locale } = useRouter() const cards = newsJson[locale as keyof typeof newsJson] return ( {/* CSS files for react-slick */} {/* Left Icon */} slider?.slickPrev()} > {/* Right Icon */} slider?.slickNext()} > {/* Slider */} setSlider(slider)}> {cards.map((card, index) => ( {/* This is the block you need to change, to customize the caption */} {card.title} {card.text.split('
').map((str, index) => (

{str}

))}
))}
) }