import React from 'react' import PropTypes from 'prop-types' import classNames from 'classnames' import Button from './button' import Tag from './tag' import { OptionalLink } from './link' import { InlineCode } from './code' import { H1, Label, InlineList, Help } from './typography' import Icon from './icon' import classes from '../styles/title.module.sass' const MetaItem = ({ label, url, children, help }) => ( {children} {help && ( <> {' '} {help} )} ) const Title = ({ id, title, tag, version, teaser, source, image, apiDetails, children, ...props }) => { const hasApiDetails = Object.values(apiDetails).some(v => v) const metaIconProps = { className: classes.metaIcon, width: 18 } return (
{(image || source) && (
{source && ( )} {image && (
)}
)}

{title}

{(tag || version) && (
{tag && {tag}} {version && ( {version} )}
)} {hasApiDetails && ( {apiDetails.stringName && ( {apiDetails.stringName} )} {apiDetails.baseClass && ( {apiDetails.baseClass.title} )} {apiDetails.trainable != null && ( {apiDetails.trainable ? ( ) : ( )} )} )} {teaser &&
{teaser}
} {children}
) } Title.propTypes = { title: PropTypes.string, tag: PropTypes.string, teaser: PropTypes.node, source: PropTypes.string, image: PropTypes.string, children: PropTypes.node, } export default Title