import { useState } from "react" import { CurrencyInput } from "@medusajs/ui" export default function CurrencyInputError() { const [value, setValue] = useState("0") const [touched, setTouched] = useState(false) const isError = touched && (!value || parseFloat(value) <= 0) return (
setValue(val)} aria-label="Amount" aria-invalid={isError} onBlur={() => setTouched(true)} min={0.01} /> {isError && (
Amount must be greater than 0
)}
) }