@redocly/graphql-docs
Version:
Redocly GraphQL docs
2 lines (1 loc) • 1.01 kB
JavaScript
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{isEnumType as s}from"graphql";import{memo as a,useMemo as d}from"react";import{MiddleSection as l,useStore as p}from"../../app/index.js";import{Markdown as c}from"../../markdown/index.js";import{useSettings as u}from"../../settings/index.js";import{ShareLink as f}from"../../navigation/index.js";import{Box as h}from"../../common/index.js";import{StyledItemHeader as x}from"../../common/components/Headers.js";import{Annotation as g,ValueList as j}from"../components/index.js";function k({name:o,path:n}){const r=p(),{markdown:m}=u(),t=d(()=>r?.getType(o),[o,r]);return s(t)?i(l,{"data-testid":t.name,children:[i(x,{"data-testid":"title",children:[e(f,{to:n,"aria-label":`link to ${t.name}`}),t.name]}),e(g,{"data-testid":"object-description",children:e(c,{rawMarkdown:t.description,parser:m?.parser})}),t.getValues().length?e(h,{"data-testid":o,direction:"column",children:e(j,{values:t.getValues()})}):null]}):null}const _=a(k);export{_ as EnumItem};