codex/broker-accounts-page #34
@ -1,5 +1,7 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import { Box } from '@mui/material';
|
||||
import { Heading, Text } from '@moex-vibe/design-system';
|
||||
import {
|
||||
BROKER_OPERATION_TYPE_OPTIONS,
|
||||
isBrokerOperationType,
|
||||
@ -32,7 +34,9 @@ export function BrokerOperationsPage() {
|
||||
}
|
||||
|
||||
const history = operations.error ? (
|
||||
<p role="alert">Не удалось загрузить историю операций</p>
|
||||
<Text component="p" tone="negative" role="alert">
|
||||
Не удалось загрузить историю операций
|
||||
</Text>
|
||||
) : (
|
||||
<BrokerOperationsTable
|
||||
title="История операций"
|
||||
@ -53,13 +57,15 @@ export function BrokerOperationsPage() {
|
||||
);
|
||||
|
||||
return (
|
||||
<section aria-labelledby="broker-operations-heading">
|
||||
<div className="broker-operations__toolbar">
|
||||
<h2 id="broker-operations-heading" style={{ fontSize: 20, margin: 0 }}>
|
||||
<Box component="section" aria-labelledby="broker-operations-heading">
|
||||
<Box
|
||||
sx={{ display: 'flex', alignItems: 'end', justifyContent: 'space-between', gap: 2, mb: 2 }}
|
||||
>
|
||||
<Heading level={2} id="broker-operations-heading">
|
||||
Операции
|
||||
</h2>
|
||||
<label>
|
||||
<span>Тип операции</span>
|
||||
</Heading>
|
||||
<Box component="label" sx={{ display: 'grid', gap: 0.5, color: 'text.secondary' }}>
|
||||
<Text variant="label">Тип операции</Text>
|
||||
<select value={selectedType} onChange={handleTypeChange}>
|
||||
<option value="">Все операции</option>
|
||||
{BROKER_OPERATION_TYPE_OPTIONS.map((option) => (
|
||||
@ -68,9 +74,9 @@ export function BrokerOperationsPage() {
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</Box>
|
||||
</Box>
|
||||
{history}
|
||||
</section>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import { Box } from '@mui/material';
|
||||
import { Heading, Text } from '@moex-vibe/design-system';
|
||||
import { useBrokerPositions } from '@/entities/broker-position';
|
||||
import { useBrokerAccountContext } from '@/widgets/broker-account-layout';
|
||||
import { BrokerPositionTable } from '@/widgets/broker-positions-table';
|
||||
@ -15,14 +17,14 @@ export function BrokerPositionsPage({ type, title }: BrokerPositionsPageProps) {
|
||||
|
||||
if (positions.error) {
|
||||
return (
|
||||
<section aria-labelledby={`broker-${type}-heading`}>
|
||||
<h2 id={`broker-${type}-heading`} style={{ fontSize: 20, margin: 0 }}>
|
||||
<Box component="section" aria-labelledby={`broker-${type}-heading`}>
|
||||
<Heading level={2} id={`broker-${type}-heading`}>
|
||||
{title}
|
||||
</h2>
|
||||
<p role="alert">
|
||||
</Heading>
|
||||
<Text component="p" tone="negative" role="alert">
|
||||
{type === 'share' ? 'Не удалось загрузить акции' : 'Не удалось загрузить облигации'}
|
||||
</p>
|
||||
</section>
|
||||
</Text>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user