import React from "react"; import { Box, Flex } from "../Box"; import { SwapVertIcon } from "../Svg"; import Text from "../Text/Text"; import { StyledBalanceInput, StyledInput, SwitchUnitsButton, UnitContainer } from "./styles"; import { BalanceInputProps } from "./types"; const BalanceInput: React.FC> = ({ value, placeholder = "0.0", onUserInput, currencyValue, inputProps, innerRef, isWarning = false, decimals = 18, unit, appendComponent, switchEditingUnits, ...props }) => { const handleOnChange = (e: React.ChangeEvent) => { if (e.currentTarget.validity.valid) { onUserInput(e.currentTarget.value.replace(/,/g, ".")); } }; return ( {appendComponent} {unit && {unit}} {currencyValue && ( {currencyValue} )} {switchEditingUnits && ( )} ); }; export default BalanceInput;