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

Function Interface

components/graphql/Interface.tsx:14–47  ·  view source on GitHub ↗
({ item, objects }: Props)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

useTranslationFunction · 0.90

Tested by

no test coverage detected