"use client"; import "photoswipe/style.css"; import { zodResolver } from "@hookform/resolvers/zod"; import { Minus, Plus } from "lucide-react"; import PhotoSwipeLightbox from "photoswipe/lightbox"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import type { ControllerRenderProps } from "react-hook-form"; import { Controller, useForm } from "react-hook-form"; import z from "zod"; import { AspectRatio } from "@/components/ui/aspect-ratio"; import { badgeVariants } from "@/components/ui/badge"; import { Button, buttonVariants } from "@/components/ui/button"; import type { CarouselApi } from "@/components/ui/carousel"; import { Carousel, CarouselContent, CarouselItem, } from "@/components/ui/carousel"; import { Field, FieldLabel } from "@/components/ui/field"; import { Input } from "@/components/ui/input"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { cn } from "@/lib/utils"; interface ProductImagesProps { images: Array<{ srcset: string; src: string; alt: string; width: number; height: number; sizes: string; }>; galleryID: string; } interface PriceProps { regular: number; currency: string; } type option = { id: string; label: string; value: string; color?: string; }; interface Hinges { label: string; id: string; name: FieldName; options?: option[]; min?: number; max?: number; } interface ProductFormProps { hinges?: Record; selected?: FormType; } type FormType = z.infer; type FieldName = keyof FormType; interface RadioGroupProps { options?: Array