import { Flex, useColorMode } from "@chakra-ui/react"; import { Heading, Text } from "tw-components"; type CustomToolTipProps = { time: string; hoverKey: string; values: Record; }; const formattingOptions: Intl.DateTimeFormatOptions = { year: "numeric", month: "short", day: "numeric", }; export const StackToolTip: React.FC = ({ time, values, hoverKey, }) => { const { colorMode } = useColorMode(); return ( Date {new Date(time).toLocaleDateString(undefined, formattingOptions)} {Object.entries(values) .reverse() .map(([key, value]) => ( {hoverKey && key !== hoverKey ? ( `${key}: ` ) : ( {key}: )} {value.toLocaleString()} ))} ); };