"use client"; import "photoswipe/style.css"; import { zodResolver } from "@hookform/resolvers/zod"; import type { LucideIcon } from "lucide-react"; import { ChevronLeft, ChevronRight, Heart, Minus, Plus, Ruler, Shirt, Truck, ZoomIn, } from "lucide-react"; import PhotoSwipeLightbox from "photoswipe/lightbox"; import { useCallback, useEffect, useRef, useState } from "react"; import type { ControllerRenderProps } from "react-hook-form"; import { Controller, useForm } from "react-hook-form"; import z from "zod"; import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from "@/components/ui/accordion"; import { AspectRatio } from "@/components/ui/aspect-ratio"; import { Badge, 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 { useGoogleFont } from "@/hooks/use-google-font"; import { cn } from "@/lib/utils"; type StockStatusCode = "IN_STOCK" | "OUT_OF_STOCK"; interface StockInfo { stockStatusCode?: StockStatusCode; stockQuantity?: number; } type option = { id: string; label: string; value: string; stockInfo: StockInfo; }; interface Hinges { label: string; id: string; name: FieldName; options?: option[]; min?: number; max?: number; } interface QuantityProps { field: ControllerRenderProps; max?: number; min?: number; id?: string; } interface ProductFormProps { hinges?: Record; selected: FormType; } interface RadioGroupProps { options?: Array