import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import{memo}from"react";import styled from"styled-components";import{Markdown}from"../Markdown";import{SecuritySchemeItem}from"./SecuritySchemeItem";import{StyledLink,Tag}from"./styled";function OAuthFlowComponent({flow:e}){const t=Object.keys((null==e?void 0:e.scopes)||{});return _jsxs(_Fragment,{children:[_jsx(SecuritySchemeItem,{label:"Authorization URL:",value:(null==e?void 0:e.authorizationUrl)&&_jsx(StyledLink,{target:"_blank",rel:"noopener noreferrer",href:null==e?void 0:e.authorizationUrl,children:null==e?void 0:e.authorizationUrl})}),_jsx(SecuritySchemeItem,{label:"Token URL:",value:null==e?void 0:e.tokenUrl}),_jsx(SecuritySchemeItem,{label:"Refresh URL:",value:null==e?void 0:e.refreshUrl}),t.length&&_jsxs(_Fragment,{children:[_jsx(SecuritySchemeItem,{label:"Scopes",value:" "}),t.map((t=>_jsx(SecuritySchemeItem,{label:_jsx(StyledTag,{className:"tag-grey",children:t}),value:_jsx(Markdown,{source:(null==e?void 0:e.scopes[t])||""})},t)))]})||null]})}const StyledTag=styled(Tag)`
  margin-left: var(--spacing-xs);
`;export const OAuthFlow=memo(OAuthFlowComponent);
//# sourceMappingURL=OAuthFlow.js.map