mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 16:35:42 +00:00
feat(reports): clamp report descriptions with a show more toggle
Report descriptions run to a paragraph. ReportDescription wraps Mantine's Spoiler to clamp them to two lines, and the toggle only renders when the text actually overflows. PageHeader kept its subtitle on a hard truncate class, which would have pinned the spoiler to one line, so a ReactNode subtitle now renders as-is and owns its own layout. A string subtitle still truncates as before.
This commit is contained in:
@@ -58,9 +58,15 @@ export function PageHeader({
|
||||
{meta}
|
||||
</Group>
|
||||
{subtitle ? (
|
||||
<Text c="dimmed" size="sm" mt={4} className="truncate">
|
||||
{subtitle}
|
||||
</Text>
|
||||
typeof subtitle === "string" ? (
|
||||
<Text c="dimmed" size="sm" mt={4} className="truncate">
|
||||
{subtitle}
|
||||
</Text>
|
||||
) : (
|
||||
// A component subtitle handles its own layout — truncating it
|
||||
// to one line would defeat e.g. an expandable description.
|
||||
<div style={{ marginTop: 4 }}>{subtitle}</div>
|
||||
)
|
||||
) : null}
|
||||
</div>
|
||||
</Group>
|
||||
|
||||
Reference in New Issue
Block a user