"use client"; import { zodResolver } from "@hookform/resolvers/zod"; import { ClockFading, Heart, ShoppingBag } from "lucide-react"; import { Fragment } from "react"; import type { ControllerRenderProps, UseFormReturn } from "react-hook-form"; import { useForm } from "react-hook-form"; import { Controller } from "react-hook-form"; import z from "zod"; import { Price, PriceValue } from "@/components/shadcnblocks/price"; import { AspectRatio } from "@/components/ui/aspect-ratio"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardTitle } from "@/components/ui/card"; import { Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger, } from "@/components/ui/drawer"; import { Field, FieldLabel } from "@/components/ui/field"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; import { cn } from "@/lib/utils"; const STOCK_STATUS = { IN_STOCK: "IN_STOCK", OUT_OF_STOCK: "OUT_OF_STOCK", LOW_STOCK: "LOW_STOCK", } as const; type StockStatusCode = keyof typeof STOCK_STATUS; type option = { id: string; label: string; value: string; stockStatusCode: StockStatusCode; }; type FormType = z.infer; type FieldName = keyof FormType; interface ProductPrice { regular: number; sale?: number; discountPercent?: string; currency: string; } interface ProductFormProps { sizeHinges?: { name: FieldName; label: string; options: Array