import * as React from 'react'; import { OperationModel } from '../../services'; import { ShelfIcon } from '../../common-elements'; import { SelectOnClick } from '../SelectOnClick/SelectOnClick'; import { OperationEndpointWrap, EndpointInfo, HttpVerb, ServerRelativeURL, ServersOverlay, ServerItem, ServerUrl, } from './styled.elements'; export interface EndpointProps { operation: OperationModel; } export interface EndpointState { expanded: boolean; } export class Endpoint extends React.PureComponent { constructor(props) { super(props); this.state = { expanded: false, }; } toggle = () => { this.setState({ expanded: !this.state.expanded }); }; render() { const { operation } = this.props; const { expanded } = this.state; return ( {operation.httpVerb}{' '} {operation.path} {operation.servers.map(server => (
{server.description}
{server.url} {operation.path}
))}
); } }