({ item }: Props)
| 11 | } |
| 12 | |
| 13 | export 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 | } |
nothing calls this directly
no test coverage detected