"use client"; import "photoswipe/style.css"; import { zodResolver } from "@hookform/resolvers/zod"; import { Ruler, ZoomIn } from "lucide-react"; import type { PhotoSwipe } from "photoswipe/lightbox"; import PhotoSwipeLightbox from "photoswipe/lightbox"; import { 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 { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Carousel, type CarouselApi, CarouselContent, CarouselItem, } from "@/components/ui/carousel"; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; import { Field, FieldLabel } from "@/components/ui/field"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { Separator } from "@/components/ui/separator"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import { useMediaQuery } from "@/hooks/useMediaQuery"; import { cn } from "@/lib/utils"; type StockStatusCode = "IN_STOCK" | "LOW_STOCK" | "OUT_OF_STOCK"; interface StockInfo { stockStatusCode: StockStatusCode; stockQuantity?: number; } interface StockMessageProps { stockInfo?: StockInfo; } type sizeChartData = Array<{ label: string; usa: string; uk: string; europe: string; }>; type Option = { id: string; label: string; stockInfo: StockInfo; value: string; }; interface Hinges { label: string; name: FieldName; id: string; sizeChart?: sizeChartData; options?: Option[]; } interface RadioGroupProps { options?: Array