"use client"; import clsx from "clsx"; import * as dnum from "dnum"; import { type ComponentProps, useMemo } from "react"; import { Button, TooltipTrigger, useLocale } from "react-aria-components"; import Pyth from "./pyth.svg"; import { DECIMALS } from "../../tokens"; import { Tooltip } from "../Tooltip"; type Props = Omit, "children"> & { children: bigint; }; export const Tokens = ({ children, ...props }: Props) => { const { locale } = useLocale(); const compactValue = useMemo( () => dnum.format([children, DECIMALS], { compact: true, locale }), [children, locale], ); const fullValue = useMemo( () => dnum.format([children, DECIMALS], { locale }), [children, locale], ); return compactValue === fullValue ? ( {compactValue} ) : ( {compactValue} {fullValue} ); }; type TokenButtonProps = Omit, "children"> & { children: string; }; const TokenButton = ({ children, className, ...props }: TokenButtonProps) => ( );