import { useState } from 'react' // Import Swiper React components import Link from 'next/link' import { Swiper, SwiperSlide } from 'swiper/react' import { Button } from 'ui' import CodeBlock from '../CodeBlock/CodeBlock' import { ArrowUpRight } from 'lucide-react' interface Example { lang: 'js' | 'py' | 'sql' title: string code: string } interface Props { size?: 'small' | 'large' content: Example[] title: string | React.ReactNode footer?: React.ReactNode text?: React.ReactNode autoHeight?: boolean documentation_link?: string } function FunctionsUsecases(props: Props) { // store API swiper instance const [apiSwiper, setApiSwiper] = useState(undefined) const [apiSwiperActiveIndex, setApiSwiperActiveIndex] = useState(0) function handleApiSwiperNavChange(e: number) { setApiSwiperActiveIndex(e) // @ts-ignore apiSwiper.slideTo(e) } return (

{props.title}

{props.text}
{props.content.map((feat, i) => { const active = i == apiSwiperActiveIndex return ( ) })} {props.documentation_link && ( )}
{props.content && props.content.map((content: Example, i) => ( {content.code} ))}
) } export default FunctionsUsecases