import { Box, Button, InputBase, Typography, useTheme } from "@mui/material"; import { styled } from "@mui/material/styles"; import { ReactElement, useRef } from "react"; import GhostStyledIcon from "../Icon/GhostIcon"; import Token from "../Token/Token"; import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'; const StyledInputBase = styled(InputBase, { shouldForwardProp: prop => prop !== "inputWidth" })( ({ inputWidth, inputFontSize }) => ({ "& .MuiInputBase-input": { padding: 0, height: "24px", }, "& input": { width: `${inputWidth}` || "136px", fontSize: `${inputFontSize}` ||"18px", "&[type=number]": { MozAppearance: "textfield", }, "&::-webkit-outer-spin-button": { WebkitAppearance: "none", margin: 0, }, "&::-webkit-inner-spin-button": { WebkitAppearance: "none", margin: 0, }, }, }), ); const SwapCard = ({ id, endString, endStringOnClick, token, placeholder = "0", inputType = "number", info, usdValue, tokenOnClick, tokenName, inputWidth, inputFontSize, maxWidth = "416px", ...props }) => { const theme = useTheme(); const onClickProps = tokenOnClick ? { onClick: tokenOnClick } : ""; const ref = useRef(null); return ( { ref.current && ref.current.focus(); }} > {(token || tokenName) && ( {typeof token === "string" ? : token} {(typeof token === "string" || tokenName) && ( {tokenName ? tokenName : token} )} {tokenOnClick && } )} {usdValue && ( ≈{usdValue} )} {info && ( {info} )} {endString && ( )} ); }; export default SwapCard;