@@ -6,6 +6,7 @@ import { useStore } from 'zustand';
6
6
import { OpenAPIPath } from './OpenAPIPath' ;
7
7
import { OpenAPISelect , OpenAPISelectItem } from './OpenAPISelect' ;
8
8
import { StaticSection } from './StaticSection' ;
9
+ import type { OpenAPIClientContext } from './context' ;
9
10
import { getOrCreateStoreByKey } from './getOrCreateStoreByKey' ;
10
11
import type { OpenAPIOperationData } from './types' ;
11
12
@@ -26,12 +27,13 @@ function OpenAPICodeSampleHeader(props: {
26
27
items : CodeSampleItem [ ] ;
27
28
data : OpenAPIOperationData ;
28
29
selectIcon ?: React . ReactNode ;
30
+ context : OpenAPIClientContext ;
29
31
} ) {
30
- const { data, items, selectIcon } = props ;
32
+ const { data, items, selectIcon, context } = props ;
31
33
32
34
return (
33
35
< >
34
- < OpenAPIPath canCopy = { false } withServer = { false } data = { data } />
36
+ < OpenAPIPath context = { context } canCopy = { false } withServer = { false } data = { data } />
35
37
{ items . length > 1 ? (
36
38
< OpenAPISelect
37
39
icon = { selectIcon }
@@ -56,8 +58,9 @@ export function OpenAPICodeSampleBody(props: {
56
58
items : CodeSampleItem [ ] ;
57
59
data : OpenAPIOperationData ;
58
60
selectIcon ?: React . ReactNode ;
61
+ context : OpenAPIClientContext ;
59
62
} ) {
60
- const { items, data, selectIcon } = props ;
63
+ const { items, data, selectIcon, context } = props ;
61
64
if ( ! items [ 0 ] ) {
62
65
throw new Error ( 'No items provided' ) ;
63
66
}
@@ -72,7 +75,14 @@ export function OpenAPICodeSampleBody(props: {
72
75
73
76
return (
74
77
< StaticSection
75
- header = { < OpenAPICodeSampleHeader selectIcon = { selectIcon } data = { data } items = { items } /> }
78
+ header = {
79
+ < OpenAPICodeSampleHeader
80
+ context = { context }
81
+ selectIcon = { selectIcon }
82
+ data = { data }
83
+ items = { items }
84
+ />
85
+ }
76
86
className = "openapi-codesample"
77
87
>
78
88
< div id = { selected . key as string } className = "openapi-codesample-panel" >
0 commit comments