UNPKG

@redocly/graphql-docs

Version:

Redocly GraphQL docs

2 lines (1 loc) 1.11 kB
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{memo as c,useMemo as p}from"react";import{useThemeHooks as d}from"@redocly/theme";import{Box as l}from"../../common/index.js";import{MiddleSection as g,RightSection as u,useStore as f}from"../../app/index.js";import{Markdown as h}from"../../markdown/index.js";import{useSettings as w}from"../../settings/index.js";import{SectionHeader as x}from"../../common/components/SectionHeader.js";import{Annotation as j,Arguments as S,LocationList as k}from"../components/index.js";function v({name:o,path:n}){const r=f(),{markdown:s}=w(),{useTranslate:a}=d(),{translate:m}=a(),t=p(()=>r?.getDirective(o),[o,r]);return t?i(l,{"data-testid":t.name,direction:"row",wrap:"wrap",gap:"64px",children:[i(g,{"data-testid":t.name,children:[e(x,{name:t.name,path:n}),e(j,{"data-testid":"object-description",children:e(h,{rawMarkdown:t.description,parser:s?.parser})}),!!t.args.length&&e(S,{args:t.args,title:m("graphql.arguments.label","Arguments")})]}),t.locations.length?e(u,{children:e(k,{locations:t.locations})}):null]}):null}const q=c(v);export{q as DirectiveItem};