UNPKG

@redocly/graphql-docs

Version:

Redocly GraphQL docs

2 lines (1 loc) 943 B
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{isEnumType as m}from"graphql";import{memo as a,useMemo as p}from"react";import{MiddleSection as d,useStore as u}from"../../app/index.js";import{Markdown as c}from"../../markdown/index.js";import{useSettings as l}from"../../settings/index.js";import{SectionHeader as f}from"../../common/components/SectionHeader.js";import{Box as x}from"../../common/index.js";import{Annotation as g,RequiresScopesButton as h,ValueList as j}from"../components/index.js";function S({name:o,path:n}){const r=u(),{markdown:s}=l(),t=p(()=>r?.getType(o),[o,r]);return m(t)?i(d,{"data-testid":t.name,children:[e(f,{name:t.name,path:n}),e(g,{"data-testid":"object-description",children:e(c,{rawMarkdown:t.description,parser:s?.parser})}),e(h,{type:t,isItem:!0}),t.getValues().length?e(x,{"data-testid":o,direction:"column",children:e(j,{values:t.getValues()})}):null]}):null}const _=a(S);export{_ as EnumItem};