"use client"; import { zodResolver } from "@hookform/resolvers/zod"; import { CircleCheck, Star, StarHalf } from "lucide-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, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, } from "@/components/ui/carousel"; 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; } type option = { id: string; label: string; stockInfo: StockInfo; color?: string; value: string; }; interface Hinges { label: string; id: string; name: FieldName; options?: option[]; min?: number; max?: number; } interface ProductImagesProps { images: Array<{ srcset: string; src: string; alt: string; width: number; height: number; sizes: string; }>; } interface ReviewsProps { rate: number; totalReviewers: string; } interface PriceProps { regular: number; sale?: number; currency: string; text?: string; } interface ProductInfoProps { info?: Array<{ label: string; value: string; }>; } type FormType = z.infer; type FieldName = keyof FormType; type SizeOptionProps = option; interface RadioGroupProps { options?: Array