Added market stage bage

This commit is contained in:
romanskijdev 2026-11-13 17:35:56 +03:00
parent 38bb876835
commit 42e91bc875
2 changed files with 76 additions and 34 deletions

View File

@ -8,7 +8,7 @@ import { modals } from '@mantine/modals'
import { import {
IconDeviceFloppy, IconSettings, IconSearch, IconDeviceFloppy, IconSettings, IconSearch,
IconFilter, IconUserSearch, IconRefresh, IconArrowLeft, IconFilter, IconUserSearch, IconRefresh, IconArrowLeft,
IconPaperclip, IconSend IconPaperclip, IconSend, IconInfoCircle
} from '@tabler/icons-react' } from '@tabler/icons-react'
import { useVirtualizer } from '@tanstack/react-virtual' import { useVirtualizer } from '@tanstack/react-virtual'
import { useNavigate, useParams } from 'react-router-dom' import { useNavigate, useParams } from 'react-router-dom'
@ -506,6 +506,8 @@ export default function OrdersPage({ onError }: { onError: (msg: string) => void
</Group> </Group>
</Stack> </Stack>
{/* --- ИЗМЕНЕНИЯ ЗДЕСЬ: Обернули кнопки и информацию о рынке в Stack --- */}
<Stack align="flex-end" gap="sm">
<Group align="center" gap="md"> <Group align="center" gap="md">
{!isReadOnly && ( {!isReadOnly && (
isSupplementaryMode ? ( isSupplementaryMode ? (
@ -540,6 +542,44 @@ export default function OrdersPage({ onError }: { onError: (msg: string) => void
) )
)} )}
</Group> </Group>
{/* БЛОК С ИНФОРМАЦИЕЙ О РЫНКЕ */}
{data.settings?.market_stage && (
<Paper
withBorder
p="xs"
radius="md"
style={{
borderLeft: '4px solid var(--mantine-color-blue-filled)',
minWidth: 300,
maxWidth: 450
}}
>
<Group justify="space-between" mb={6}>
<Group gap={6}>
<IconInfoCircle size={16} color="var(--mantine-color-blue-filled)" />
<Text size="xs" fw={700} c="dimmed" tt="uppercase">Ситуация на рынке</Text>
</Group>
<Badge
size="sm"
variant="light"
color={
data.settings.market_stage.toLowerCase() === 'растущий' ? 'teal' :
data.settings.market_stage.toLowerCase() === 'падающий' ? 'red' :
'gray'
}
>
{data.settings.market_stage}
</Badge>
</Group>
{data.settings.market_stage_comment && (
<Text size="sm" style={{ whiteSpace: 'pre-wrap', lineHeight: 1.3 }}>
{data.settings.market_stage_comment}
</Text>
)}
</Paper>
)}
</Stack>
</Group> </Group>
<Paper withBorder shadow="sm" style={{ flexGrow: 1, display: 'flex', flexDirection: 'column', overflow: 'hidden' }}> <Paper withBorder shadow="sm" style={{ flexGrow: 1, display: 'flex', flexDirection: 'column', overflow: 'hidden' }}>

View File

@ -15,6 +15,8 @@ export interface MonthlyOrderSetting {
month?: number month?: number
year?: number year?: number
deadline_date: string | null deadline_date: string | null
market_stage: string | null
market_stage_comment: string | null
assembly_time_days: number assembly_time_days: number
} }