import { useState } from 'react' import { isIE } from 'react-device-detect' import Carousel from 'nuka-carousel' import CaseSlide from './case-study-slide' import Image from '@hashicorp/react-image' import InlineSvg from '@hashicorp/react-inline-svg' import ActiveControlDot from './img/active-control-dot.svg?include' import InactiveControlDot from './img/inactive-control-dot.svg?include' import LeftArrow from './img/left-arrow-control.svg?include' import RightArrow from './img/right-arrow-control.svg?include' export default function CaseStudyCarousel({ caseStudies, title, featuredLogos, }) { const [slideIndex, setSlideIndex] = useState(0) const caseStudySlides = caseStudies.map((caseStudy) => ( )) function renderControls() { return (
{caseStudies.map((caseStudy, stableIdx) => { return ( ) })}
) } function sideControls(icon, direction) { return ( ) } return (

{title}

{!isIE ? ( renderControls()} renderCenterLeftControls={({ previousSlide }) => { return sideControls(LeftArrow, previousSlide) }} renderCenterRightControls={({ nextSlide }) => { return sideControls(RightArrow, nextSlide) }} afterSlide={(slideIndex) => setSlideIndex(slideIndex)} > {caseStudySlides} ) : null}
{featuredLogos.map((featuredLogo) => ( {featuredLogo.companyName} ))}
) }