import styles from './ConvertField.module.css' export type Currency = 'USDT' | 'RUB' export interface ConvertFieldData { value: string currency: Currency onChange?: (raw: string) => void error?: string } interface Props extends ConvertFieldData { label?: string compact?: boolean } export function ConvertField({ label, value, currency, onChange, error, compact }: Props) { const readOnly = !onChange return (
{label &&
{label}
}
onChange(e.target.value) : undefined} readOnly={readOnly} placeholder="0" inputMode={readOnly ? undefined : 'decimal'} />
{currency === 'USDT' ? '₮' : '₽'} {currency}
{error &&
{error}
}
) }