import { Card, SimpleGrid, Stack, Text } from "@mantine/core"; import type { FC } from "react"; import { useTranslation } from "react-i18next"; import { Link } from "react-router"; import type { BrokerageAccount } from "../api/useBrokerageAccounts"; import { accountTypeKey } from "../model/display"; import classes from "./BrokerageAccountList.module.css"; type BrokerageAccountListProps = { accounts: BrokerageAccount[] }; const BrokerageAccountList: FC = (props) => { const { accounts } = props; const { t } = useTranslation(); return ( {accounts.map((account) => ( {t(accountTypeKey(account.type))} {account.name} {account.openedOn ? ( {t("accounts.openedOn", { date: new Intl.DateTimeFormat("ru-RU", { dateStyle: "long", timeZone: "UTC", }).format(new Date(`${account.openedOn}T00:00:00Z`)), })} ) : null} ))} ); }; export { BrokerageAccountList };