Skip to content

Commit 0d4607e

Browse files
committed
ui: FieldRow — vertical layout (label above value) instead of side-by-side
1 parent 21a9caa commit 0d4607e

1 file changed

Lines changed: 6 additions & 18 deletions

File tree

ui/src/shared/ui/FieldRow.tsx

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,18 @@
1-
import { Box, Typography, useTheme } from '@mui/material'
1+
import { Box } from '@mui/material'
22
import type { ReactNode } from 'react'
3+
import { FieldLabel } from './FieldLabel.tsx'
34

45
interface FieldRowProps {
56
label: string
67
children: ReactNode
78
divider?: boolean
89
}
910

10-
export function FieldRow({ label, children, divider = true }: FieldRowProps) {
11-
const { palette } = useTheme()
11+
export function FieldRow({ label, children, divider: _divider }: FieldRowProps) {
1212
return (
13-
<Box
14-
sx={{
15-
display: 'flex',
16-
alignItems: 'flex-start',
17-
py: 1.25,
18-
borderBottom: divider ? `1px solid ${palette.custom.border}` : 'none',
19-
}}
20-
>
21-
<Typography
22-
variant="body2"
23-
sx={{ width: 200, flexShrink: 0, color: palette.custom.textMuted, pt: 0.25 }}
24-
>
25-
{label}
26-
</Typography>
27-
<Box sx={{ flex: 1, minWidth: 0 }}>{children}</Box>
13+
<Box sx={{ mb: 1.5 }}>
14+
<FieldLabel>{label}</FieldLabel>
15+
<Box sx={{ minWidth: 0 }}>{children}</Box>
2816
</Box>
2917
)
3018
}

0 commit comments

Comments
 (0)