UNPKG

@redocly/graphql-docs

Version:

Redocly GraphQL docs

2 lines (1 loc) 1.04 kB
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{memo as c,useMemo as p}from"react";import{MiddleSection as m,RightSection as d,useStore as f}from"../../app/index.js";import{Markdown as l}from"../../markdown/index.js";import{useSettings as u}from"../../settings/index.js";import{Box as h}from"../../common/index.js";import{SectionHeader as S}from"../../common/components/SectionHeader.js";import{Annotation as g,ReferenceList as w,RequiresScopesButton as x}from"../components/index.js";function j({name:r,path:s}){const o=f(),{markdown:a}=u(),{type:t,references:n}=p(()=>({type:o?.getType(r),references:o?.getTypeReferences(r)}),[r,o]);return t?i(h,{"data-testid":t.name,direction:"row",wrap:"wrap",gap:"64px",children:[i(m,{"data-testid":r,children:[e(S,{name:t.name,path:s}),e(g,{"data-testid":"object-description",children:e(l,{rawMarkdown:t.description,parser:a?.parser})}),e(x,{type:t,isItem:!0})]}),n?.length?e(d,{"data-testid":"right-section",children:e(w,{references:n})}):null]}):null}const b=c(j);export{b as ScalarItem};