import React from 'react' import PropTypes from 'prop-types' import {Comment, Info, FileCode, Alert} from '@githubprimer/octicons-react' import {Box, Flex, Link, StyledOcticon as Octicon, Text} from '@primer/components' import StatusLabel from './StatusLabel' export default function PackageHeader(props) { const {description, internal = false, package: pkg, source = '', status, status_issue: issue, ...rest} = props const isPackage = pkg && source.indexOf('/modules/') > -1 const isInternal = internal || source.indexOf('https://github.com/github/github') === 0 let info if (isInternal) { info = ( For GitHub internal use only ) } else if (isPackage) { info = ( <> Package: {pkg.name} ) } else if (description) { info = ( {description} ) } return ( {status ? : null} {info} {issue ? ( ) : null} {source ? ( ) : null} ) } PackageHeader.propTypes = { package: PropTypes.shape({ name: PropTypes.string.isRequired }), source: PropTypes.string, status: PropTypes.string }