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

Function Object

components/graphql/Object.tsx:13–46  ·  view source on GitHub ↗
({ item }: Props)

Source from the content-addressed store, hash-verified

11}
12
13export function Object({ item }: Props) {
14 const { locale } = useRouter()
15 const { t } = useTranslation('products')
16 const heading1 = t('graphql.reference.implements')
17 const heading2 = t('graphql.reference.fields')
18
19 return (
20 <GraphqlItem item={item}>
21 {item.implements && (
22 <>
23 <h3>{heading1}</h3>
24 <ul>
25 {item.implements.map((implement: ImplementsT) => (
26 <li key={`${implement.id}-${implement.href}-${implement.name}`}>
27 <code>
28 <Link href={implement.href} locale={locale}>
29 {implement.name}
30 </Link>
31 </code>
32 </li>
33 ))}
34 </ul>
35 </>
36 )}
37
38 {item.fields && (
39 <>
40 <h3>{heading2}</h3>
41 <Table fields={item.fields} />
42 </>
43 )}
44 </GraphqlItem>
45 )
46}

Callers

nothing calls this directly

Calls 1

useTranslationFunction · 0.90

Tested by

no test coverage detected