import styled from "@emotion/styled"; import type { Token } from "../../../../../bridge/index.js"; import { getCachedChain } from "../../../../../chains/utils.js"; import type { ThirdwebClient } from "../../../../../client/client.js"; import type { SupportedFiatCurrency } from "../../../../../pay/convert/type.js"; import { useCustomTheme } from "../../../../core/design-system/CustomThemeProvider.js"; import { spacing } from "../../../../core/design-system/index.js"; import { FiatValue } from "../../ConnectWallet/screens/Buy/swap/FiatValue.js"; import { Container } from "../../components/basic.js"; import { Button } from "../../components/buttons.js"; import { Text } from "../../components/text.js"; import { TokenAndChain } from "./TokenAndChain.js"; export function TokenBalanceRow({ client, token, amount, onClick, style, currency, }: { client: ThirdwebClient; token: Token; amount: string; onClick: (token: Token) => void; style?: React.CSSProperties; currency?: SupportedFiatCurrency; }) { const chain = getCachedChain(token.chainId); return ( onClick(token)} style={{ display: "flex", justifyContent: "space-between", padding: `${spacing.md} ${spacing.md}`, ...style, }} variant="secondary" > {`${Number(amount).toLocaleString(undefined, { maximumFractionDigits: 6, minimumFractionDigits: 0, })} ${token.symbol}`} ); } const StyledButton = /* @__PURE__ */ styled(Button)((props) => { const theme = useCustomTheme(); return { "&:hover": { background: theme.colors.secondaryButtonBg, }, background: "transparent", flexDirection: "row", flexWrap: "nowrap", gap: spacing.sm, justifyContent: "space-between", padding: spacing.sm, paddingRight: spacing.xs, transition: "background 200ms ease, transform 150ms ease", ...props.style, }; });