UNPKG

@redocly/graphql-docs

Version:

Redocly GraphQL docs

6 lines (5 loc) 1.2 kB
import{jsx as t,jsxs as r}from"react/jsx-runtime";import{Badge as n,PageActions as p,useThemeHooks as d}from"@redocly/theme";import{SplittedWbrText as m}from"../../../shared/index.js";import{ArrowIcon as l}from"../../../shared/icons/Arrow.js";import{ShareLink as c}from"../../navigation/index.js";import{PageActionsWrapper as g,StyledItemHeader as u}from"../../common/components/Headers.js";import{InlineArgsList as y}from"./InlineArgsList.js";import{ReturnTypeDetails as x}from"./ReturnTypeDetails.js";import{styled as f}from"../../styled-components.js";const h=f.div` display: flex; align-items: flex-start; gap: var(--spacing-unit); `;function T({type:e}){return r(h,{children:[t(l,{}),t(x,{type:e,size:"lg"})]})}function I({field:e,path:a}){const{useTranslate:i}=d(),{translate:s}=i(),o=!!e.deprecationReason;return r(g,{children:[r("div",{"data-testid":e.name+"-block",children:[r(u,{"data-testid":"title",children:[t(c,{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(y,{args:e.args,size:"lg"}),t(T,{type:e.type})]}),t(p,{pageSlug:a})]})}export{I as FieldSummary};