UNPKG

@redocly/graphql-docs

Version:

Redocly GraphQL docs

6 lines (5 loc) 1.12 kB
import{jsx as t,jsxs as r}from"react/jsx-runtime";import{Badge as n,useThemeHooks as p}from"@redocly/theme";import{SplittedWbrText as m}from"../../../shared/index.js";import{ArrowIcon as d}from"../../../shared/icons/Arrow.js";import{ShareLink as l}from"../../navigation/index.js";import{StyledItemHeader as c}from"../../common/components/Headers.js";import{InlineArgsList as u}from"./InlineArgsList.js";import{ReturnTypeDetails as g}from"./ReturnTypeDetails.js";import{styled as y}from"../../styled-components.js";const x=y.div` display: flex; align-items: flex-start; gap: var(--spacing-unit); `;function f({type:e}){return r(x,{children:[t(d,{}),t(g,{type:e,size:"lg"})]})}function A({field:e,path:a}){const{useTranslate:i}=p(),{translate:s}=i(),o=!!e.deprecationReason;return r("div",{"data-testid":e.name+"-block",children:[r(c,{"data-testid":"title",children:[t(l,{to:a,"aria-label":`link to ${e.name}`}),t(m,{text:e.name}),o&&t(n,{deprecated:!0,"data-testid":"deprecated-badge",children:s("graphql.deprecated","deprecated")})]}),t(u,{args:e.args,size:"lg"}),t(f,{type:e.type})]})}export{A as FieldSummary};