import SectionContainer from "@/components/ui/section-container"; import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, CarouselDots, CarouselCounter, } from "@/components/ui/carousel"; import Image from "next/image"; import { urlFor } from "@/sanity/lib/image"; import { cn } from "@/lib/utils"; import { PAGE_QUERY_RESULT } from "@/sanity.types"; const CAROUSEL_SIZES = { one: "basis-full", two: "basis-full md:basis-1/2", three: "basis-full md:basis-1/2 lg:basis-1/3", } as const; const IMAGE_SIZES = { one: "h-[30rem] sm:h-[40rem] lg:h-[31.25rem] xl:h-[35rem]", two: "h-[30rem] md:h-[22rem] lg:h-[30rem] xl:h-[35rem]", three: "h-[30rem] md:h-[20rem] xl:h-[25rem]", } as const; type CarouselSize = keyof typeof CAROUSEL_SIZES; type Carousel1 = Extract< NonNullable["blocks"]>[number], { _type: "carousel-1" } >; interface Carousel1Props extends Omit< NonNullable, "_type" | "_key" > { size: CarouselSize | null; indicators: "none" | "dots" | "count" | null; } export default function Carousel1({ padding, colorVariant, size = "one", indicators = "none", images, }: Carousel1Props) { return ( {images && images.length > 0 && ( {images.map((image, index) => ( {image && (
{image.alt
)}
))}
{indicators !== "none" && (
{indicators === "dots" && } {indicators === "count" && }
)}
)}
); }