UNPKG

@redocly/graphql-docs

Version:

Redocly GraphQL docs

2 lines (1 loc) 858 B
import{jsx as i,jsxs as m}from"react/jsx-runtime";import{useContext as s}from"react";import{MenuStoreContext as l}from"../../menu/index.js";import{PaginationAwareLink as n,useBaseUrlPath as d}from"../../navigation/index.js";import{ListIcon as p}from"../../common/index.js";import{joinPath as a}from"../../navigation/utils/index.js";import{ROOT_PATH as f}from"../../navigation/constants.js";import{ReferenceField as u,Value as c}from"./styled.js";function T({reference:t}){const e=s(l),r=d()||f,o=e?.getGroupIdByTypeName(t.name);return o?m(c,{"data-testid":"ref-item",children:[i(p,{size:"22px",color:"var(--border-color-primary)",style:{marginRight:"var(--spacing-sm)"}}),i(n,{to:a(r,o,t.name),children:t.name}),t.field?m(u,{"data-testid":"ref-field",children:[".",i(n,{to:a(r,o,t.name,t.field),children:t.field})]}):null]}):null}export{T as ReferenceItem};