import{jsx as t,jsxs as o,Fragment as l}from"react/jsx-runtime";import*as b from"react";import{NewTabButton as h}from"@redocly/theme/components/Buttons/NewTabButton";import{PageActions as u}from"@redocly/theme/components/PageActions/PageActions";import{Tag as p}from"@redocly/theme/components/Tag/Tag";import{CheckmarkIcon as g}from"@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon";import{MCP_SERVER_CAPABILITIES as f,MCP_SERVER_EXPERIMENTAL_CAPABILITIES as E,PAGE_ACTIONS_MCP as P}from"../../utils/mcp.js";import{PanelItem as r}from"../PanelItem/PanelItem.js";import{PanelItemsList as C}from"../PanelItem/styled.js";import{useTranslate as _}from"../../hooks/index.js";import{styled as c}from"../../styled-components.js";function O({mcpInfo:e,mcpServers:s}){const a=_();function d(i){return typeof e?.capabilities[i]=="object"&&e?.capabilities[i]?.listChanged}function m(i){return typeof e?.capabilities[i]=="object"&&e?.capabilities[i]?.subscribe}return o(C,{children:[e?.protocolVersion&&t(r,{header:a("openapi.mcp.protocolVersion","Protocol version"),title:e.protocolVersion}),e?.capabilities&&t(r,{header:a("openapi.mcp.capabilities","Capabilities"),title:t(l,{children:f.map(i=>e?.capabilities[i]?o(p,{size:"small",icon:t(g,{}),children:[i,d(i)?" (list changed)":"",m(i)?" (subscribe)":""]},i):null)})}),e?.capabilities[E]&&t(r,{header:a("openapi.mcp.experimentalCapabilities","Experimental capabilities"),title:t(x,{children:Object.entries(e?.capabilities.experimental||{}).map(([i,n])=>o(b.Fragment,{children:[o("span",{children:[i,":"]}),t(p,{children:typeof n=="object"?JSON.stringify(n):String(n)})]},i))})}),t(r,{header:a("openapi.mcp.endpoint","Endpoint"),title:t(l,{children:s[0]?.url}),actions:[t(h,{data:s[0]?.url},"NewTabButton")]}),t(r,{title:t(j,{children:t(u,{actions:P,mcpUrl:s[0]?.url})})})]})}const j=c.div`
  & button {
    width: 100%;
  }
  > div {
    padding: 0;
  }
`,x=c.div`
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;

  > * {
    justify-self: start;
  }
`;export{O as McpOverview};
