import AmountField from "react-currency-input-field" import { CurrencyType } from "../../../utils/currencies" /** * `PriceInput` interface */ export type PriceInputProps = { amount?: string currency: CurrencyType onAmountChange: (amount?: string, floatAmount?: number | null) => void } /** * A controlled input component that renders the formatted amount * and the currency of the provided price. */ function PriceInput(props: PriceInputProps) { const { amount, currency, onAmountChange } = props const { code, symbol_native, decimal_digits } = currency /** ******** COMPUTED **********/ const step = 10 ** -decimal_digits const rightOffset = 24 + symbol_native.length * 4 const placeholder = `0.${"0".repeat(decimal_digits)}` return (