File tree Expand file tree Collapse file tree 3 files changed +33
-13
lines changed
Expand file tree Collapse file tree 3 files changed +33
-13
lines changed Original file line number Diff line number Diff line change 1- .pf-v6-c-panel__main > .pdl-markdown {
1+ .pdl-masonry-tile . pf-v6-c-panel__main > .pdl-markdown {
22 padding : 1em ;
33}
44
Original file line number Diff line number Diff line change 1+ import Code from "./code/Code"
12import Markdown from "./Markdown"
23
34type Props = { children : number | string | unknown }
45
6+ function isJson ( s : string ) {
7+ try {
8+ JSON . parse ( s )
9+ return true
10+ } catch ( _err ) {
11+ return false
12+ }
13+ }
14+
515export default function Value ( { children : s } : Props ) {
6- return (
7- < >
8- { typeof s === "number " ? (
9- s
10- ) : typeof s === "string" ? (
11- < Markdown > { s === "\n" ? "*<newline>*" : s . trim ( ) } </ Markdown >
12- ) : (
13- JSON . stringify ( s , undefined , 2 )
14- ) }
15- </ >
16+ return typeof s === "number" ? (
17+ s
18+ ) : typeof s === "string " ? (
19+ isJson ( s ) ? (
20+ < Code block = { s } language = "json" />
21+ ) : (
22+ < Markdown > { s === "\n" ? "*<newline>*" : s . trim ( ) } </ Markdown >
23+ )
24+ ) : (
25+ JSON . stringify ( s , undefined , 2 )
1626 )
1727}
Original file line number Diff line number Diff line change 44 DescriptionListGroup ,
55 DescriptionListDescription ,
66 Divider ,
7+ Panel ,
8+ PanelMain ,
79} from "@patternfly/react-core"
810
911import Result from "../Result"
@@ -22,7 +24,11 @@ export default function ContextTabContent({ block }: Props) {
2224 { c . role [ 0 ] . toUpperCase ( ) + c . role . slice ( 1 ) }
2325 </ DescriptionListTerm >
2426 < DescriptionListDescription >
25- < Result result = { c . content } term = "" />
27+ < Panel isScrollable >
28+ < PanelMain >
29+ < Result result = { c . content } term = "" />
30+ </ PanelMain >
31+ </ Panel >
2632 </ DescriptionListDescription >
2733 </ DescriptionListGroup > ,
2834
@@ -31,7 +37,11 @@ export default function ContextTabContent({ block }: Props) {
3137 Where was this value defined?
3238 </ DescriptionListTerm >
3339 < DescriptionListDescription >
34- { c . defsite && < BreadcrumbBarForBlockId id = { c . defsite } /> }
40+ { c . defsite ? (
41+ < BreadcrumbBarForBlockId id = { c . defsite } />
42+ ) : (
43+ "The origin of this data is not known"
44+ ) }
3545 </ DescriptionListDescription >
3646 </ DescriptionListGroup > ,
3747
You can’t perform that action at this time.
0 commit comments