<commit_before>// @flow
import * as React from 'react';
import { Link } from 'react-router-dom';
import { Badge, Card, CardBody, CardHeader, CardText, Collapse } from 'reactstrap';
import type { ApiMethodDoc } from '../../../../model/livedoc';
import { ApiMethodDetails } from './ApiMethodDetails';
import './MethodPanel.css';

export type MethodPanelProps = {
  methodDoc: ApiMethodDoc,
  open: boolean,
  collapseUrl: string,
  expandUrl: string,
}

export const MethodPanel = ({methodDoc, open, collapseUrl, expandUrl}: MethodPanelProps) => {

  const title = methodDoc.path || methodDoc.method;
  const verbs = methodDoc.verb.map(v => <Badge key={v} style={getStyle(v)}>{v}</Badge>);
  const linkUrl = open ? collapseUrl : expandUrl;

  return <Card style={{marginBottom: '15px'}}>
    <CardHeader className="api-method-header" tag={Link} to={linkUrl}>{title} {verbs}</CardHeader>
    <Collapse isOpen={open}>
      <CardBody>
        <CardText>{methodDoc.description}</CardText>
        <ApiMethodDetails methodDoc={methodDoc}/>
      </CardBody>
    </Collapse>
  </Card>;
};<commit_msg>Remove empty space when method description is absent<commit_after>// @flow
import * as React from 'react';
import { Link } from 'react-router-dom';
import { Badge, Card, CardBody, CardHeader, CardText, Collapse } from 'reactstrap';
import type { ApiMethodDoc } from '../../../../model/livedoc';
import { ApiMethodDetails } from './ApiMethodDetails';
import './MethodPanel.css';

export type MethodPanelProps = {
  methodDoc: ApiMethodDoc,
  open: boolean,
  collapseUrl: string,
  expandUrl: string,
}

export const MethodPanel = ({methodDoc, open, collapseUrl, expandUrl}: MethodPanelProps) => {

  const title = methodDoc.path || methodDoc.method;
  const verbs = methodDoc.verb.map(v => <Badge key={v} style={getStyle(v)}>{v}</Badge>);
  const linkUrl = open ? collapseUrl : expandUrl;

  return <Card style={{marginBottom: '15px'}}>
    <CardHeader className="api-method-header" tag={Link} to={linkUrl}>{title} {verbs}</CardHeader>
    <Collapse isOpen={open}>
      <CardBody>
        {methodDoc.description && <CardText>{methodDoc.description}</CardText>}
        <ApiMethodDetails methodDoc={methodDoc}/>
      </CardBody>
    </Collapse>
  </Card>;
};
{'fraction_non_alphanumeric': 0.1594138543516874, 'fraction_numerical': 0.0017761989342806395, 'mean_word_length': 4.402877697841727, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7391236', 'n_tokens_mistral': 693, 'n_tokens_neox': 692, 'n_words': 174}