Skip to content

Commit 1dad9d1

Browse files
committed
Fixes build errors
1 parent 8f0df10 commit 1dad9d1

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

src/features/docs/view/Stoplight.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useState } from "react"
1+
import { useEffect, useState, createElement } from "react"
22
import { Box } from "@mui/material"
33
import 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

7478
export default Stoplight

0 commit comments

Comments
 (0)