"use client"; import { zodResolver } from "@hookform/resolvers/zod"; import { ChevronLeft, ChevronRight } from "lucide-react"; import { useCallback, useEffect, useState } from "react"; import type { ControllerRenderProps, UseFormReturn } from "react-hook-form"; import { Controller, useForm } from "react-hook-form"; import z from "zod"; import { AspectRatio } from "@/components/ui/aspect-ratio"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardFooter, CardHeader, CardTitle, } from "@/components/ui/card"; import type { CarouselApi } from "@/components/ui/carousel"; import { Carousel, CarouselContent, CarouselItem, } from "@/components/ui/carousel"; import { Field, FieldLabel } from "@/components/ui/field"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { cn } from "@/lib/utils"; const STOCK_STATUS = { IN_STOCK: "IN_STOCK", OUT_OF_STOCK: "OUT_OF_STOCK", } as const; type StockStatusCode = keyof typeof STOCK_STATUS; interface ListCarouselProps { productsList: Array; } type Image = { src: string; alt: string; }; type Option = { id: string; label: string; color: string; value: string; image: Image; }; interface Product { name: string; collection: { label: string; link: string; }; variantId: string; image: { src: string; alt: string; }; link: string; price: ProductPrice; quickAdd?: boolean; variants?: { name: FieldName; options: Array