import { useRef, useState } from "react"; import { Splide, SplideTrack, SplideSlide } from "@splidejs/react-splide"; import Button from "@/components/Button"; import Image from "@/components/Image"; import { pricing } from "@/mocks/pricing"; type PricingListProps = { monthly?: boolean; }; const PricingList = ({ monthly = true }: PricingListProps) => { const [activeIndex, setActiveIndex] = useState(0); const ref = useRef(null); const handleClick = (index: number) => { setActiveIndex(index); ref.current?.go(index); }; return ( setActiveIndex(newIndex)} hasTrack={false} ref={ref} > {pricing.map((item, index) => (

{item.title}

{item.description}

{item.price && ( <>
$
{monthly ? item.price : item.price !== "0" ? ( +item.price * 12 * 0.9 ).toFixed(1) : item.price}
)}
    {item.features.map((feature, index) => (
  • Check

    {feature}

  • ))}
))}
{pricing.map((item, index) => ( ))}
); }; export default PricingList;