MCPcopy Create free account
hub / github.com/github/docs / GraphqlItem

Function GraphqlItem

components/graphql/GraphqlItem.tsx:12–43  ·  view source on GitHub ↗
({ item, heading, children, headingLevel = 2 }: Props)

Source from the content-addressed store, hash-verified

10}
11
12export function GraphqlItem({ item, heading, children, headingLevel = 2 }: Props) {
13 const lowerCaseName = item.name.toLowerCase()
14 return (
15 <div>
16 {headingLevel === 2 && (
17 <h2 id={lowerCaseName}>
18 <LinkIconHeading slug={lowerCaseName} />
19 {item.name}
20 </h2>
21 )}
22 {headingLevel === 3 && (
23 <h3 id={lowerCaseName}>
24 <LinkIconHeading slug={lowerCaseName} />
25 {item.name}
26 </h3>
27 )}
28 <div
29 dangerouslySetInnerHTML={{
30 __html: item.description,
31 }}
32 />
33 <div>
34 {item.preview && <Notice item={item} variant="preview" />}
35 {item.isDeprecated && <Notice item={item} variant="deprecation" />}
36 </div>
37 <div>
38 {heading && <h4>{heading}</h4>}
39 {children}
40 </div>
41 </div>
42 )
43}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected