File tree Expand file tree Collapse file tree 1 file changed +18
-14
lines changed Expand file tree Collapse file tree 1 file changed +18
-14
lines changed Original file line number Diff line number Diff line change 1- import { useEffect , useState } from "react"
1+ import { useEffect , useState , createElement } from "react"
22import { Box } from "@mui/material"
33import LoadingWrapper from "./LoadingWrapper"
44
@@ -48,27 +48,31 @@ const ResponsiveStoplight = ({ document: apiDescriptionDocument }: { document: s
4848 height : "100%" ,
4949 padding : 2
5050 } } >
51- < Box
52- component = "elements-api"
53- apiDescriptionDocument = { apiDescriptionDocument }
54- router = "hash"
55- layout = "stacked"
56- />
51+ < ElementsAPI document = { apiDescriptionDocument } layout = "stacked" />
5752 </ Box >
5853 < Box sx = { {
5954 display : { xs : "none" , sm : "block" } ,
6055 width : "100%" ,
6156 height : "100%" ,
6257 } } >
63- < Box
64- component = "elements-api"
65- apiDescriptionDocument = { apiDescriptionDocument }
66- router = "hash"
67- layout = "sidebar"
68- />
58+ < ElementsAPI document = { apiDescriptionDocument } layout = "sidebar" />
6959 </ Box >
7060 </ >
7161 )
72- }
62+ }
63+
64+ const ElementsAPI = ( {
65+ document : apiDescriptionDocument ,
66+ layout
67+ } : {
68+ document : string ,
69+ layout : "sidebar" | "stacked"
70+ } ) => {
71+ return createElement ( "elements-api" , {
72+ apiDescriptionDocument,
73+ router : "hash" ,
74+ layout : layout
75+ } )
76+ }
7377
7478export default Stoplight
You can’t perform that action at this time.
0 commit comments