{accountType
? `${
AccountTypeMapping[
accountType as keyof typeof Schema.AccountType
]
} Account`
: t('Select account type')}
}
>
{[
Schema.AccountType.ACCOUNT_TYPE_GENERAL,
Schema.AccountType.ACCOUNT_TYPE_BOND,
Schema.AccountType.ACCOUNT_TYPE_MARGIN,
].map((type) => (
{
setAccountType(type as Schema.AccountType);
// if not a margin account clear any market selection
if (type !== Schema.AccountType.ACCOUNT_TYPE_MARGIN) {
setMarket(null);
}
}}
>
{AccountTypeMapping[type as keyof typeof Schema.AccountType]}
))}
{asset ? asset.symbol : t('Select asset')}
}
>
{assets.map((a) => (
{
setAssetId(a.id);
// if the selected asset is different to the selected market clear the market
if (
a.id !==
market?.tradableInstrument.instrument.product
.settlementAsset.id
) {
setMarket(null);
}
}}
>
{a.symbol}
))}
{market
? market.tradableInstrument.instrument.code
: t('Select market')}
}
>
{market && (
setMarket(null)}>
{t('All markets')}
)}
{markets?.map((m) => (
resolveMarket(m)}
>
{m.tradableInstrument.instrument.code}
))}
) =>
setRange(e.target.value as keyof typeof DateRange)
}
size="sm"
/>