"use client" import { Input } from "@/components/ui/input"; import { ProductSKUs } from "components/product/sku-generator"; import { Combox } from "components/ui/combox"; import { collectionsSKUs, garmentHandleKeys } from "constants/sku"; import { capitalizeFirstLetter, copyText } from "lib/helpers/actions"; import { useMemo, useState } from "react"; // type SKUSelectorState = { // garment?: keyof typeof garmentHandleKeys, // collection?: keyof typeof collectionsSKUs, // }; export function NewProductHelpComponent() { // const [open, setOpen] = useState(false) const [collection, setCollection] = useState(null); // TODO: preselect tshirt const [garment, setGarment] = useState(null); // const [title, setTitle] = useState(null); const [number, setNumber] = useState(null); const title = useMemo(() => { const title = collection && garment && `${capitalizeFirstLetter(collection)}scape No.${number} ${garment}`; console.log("🍓🍋🍊 title", title); return title; }, [collection, garment, number]); const garmentOptions = Object.entries(garmentHandleKeys).map(([fullGarmentName, garmentHandle]) => ({ label: fullGarmentName as keyof typeof garmentHandleKeys, key: fullGarmentName as keyof typeof garmentHandleKeys, })) const collectionOptions = Object.entries(collectionsSKUs).map(([scape, scapeNumber]) => ({ label: scape as keyof typeof collectionsSKUs, key: scape as keyof typeof collectionsSKUs })) return (

New Product Creator

setCollection(key as keyof typeof collectionsSKUs)} currentKey={collection || null} />
setNumber(e.target.value)} />
setGarment(key as keyof typeof garmentHandleKeys)} currentKey={garment || null} />
{garment && collection && number && title && <>
copyText(title)} > {title}
}
); }