"use client"; import "photoswipe/style.css"; import { zodResolver } from "@hookform/resolvers/zod"; import PhotoSwipeLightbox from "photoswipe/lightbox"; import { useEffect, 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 { Button } from "@/components/ui/button"; import type { CarouselApi } from "@/components/ui/carousel"; import { Carousel, CarouselContent, CarouselItem, } from "@/components/ui/carousel"; import { Field } from "@/components/ui/field"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { cn } from "@/lib/utils"; type StockStatusCode = "IN_STOCK" | "OUT_OF_STOCK"; interface StockInfo { stockStatusCode: StockStatusCode; stockQuantity?: number; } interface PriceProps { regular: number; sale?: number; currency: string; stockInfo?: StockInfo; } type option = { id: string; label: string; value: string; }; interface Hinges { label: string; id?: string; name: FieldName; options?: option[]; } interface ProductFormProps { hinges: Record; selected: { size: string; }; } type FormType = z.infer; type FieldName = keyof FormType; interface RadioGroupProps { options?: Array