import type { FC } from "react"; import { Badge, Text } from "@mantine/core"; import { useTranslation } from "react-i18next"; import { formatSnapshotTime } from "@/shared/lib"; type InstrumentQuoteStatusProps = { quote?: { priceAt: null | string; tradingStatus: null | string }; }; const InstrumentQuoteStatus: FC = (props) => { const { quote } = props; const { t } = useTranslation(); return ( <> {t(`stock.trading.${quote?.tradingStatus}`, { defaultValue: t("stock.trading.unknown"), })} {!!quote?.priceAt && ( {t("stock.priceAt", { date: formatSnapshotTime(quote.priceAt) })} )} ); }; export { InstrumentQuoteStatus };