@@ -2,6 +2,7 @@ import React from 'react'
22import PropTypes from 'prop-types'
33import { Comment , Info , FileCode , Alert , PrimitiveDot } from '@githubprimer/octicons-react'
44import { BorderBox , Box , Flex , Link , StyledOcticon as Octicon , Text } from '@primer/components'
5+ import StatusLabel from './StatusLabel'
56
67export default function PackageHeader ( props ) {
78 const { description, internal = false , package : pkg , source = '' , status, status_issue : issue , ...rest } = props
@@ -38,12 +39,7 @@ export default function PackageHeader(props) {
3839 return (
3940 < Flex justifyContent = "space-between" mb = { 4 } { ...rest } >
4041 < Text is = "div" fontSize = { 1 } >
41- { status ? (
42- < BorderBox is = "a" href = "/css/whats-new/status-key" display = "inline-block" px = { 2 } py = { 1 } mr = { 2 } >
43- < Octicon icon = { PrimitiveDot } color = { getStatusColor ( status ) } mr = { 2 } />
44- { status }
45- </ BorderBox >
46- ) : null }
42+ { status ? < StatusLabel status = { status } is = "a" href = "/css/whats-new/status-key" mr = { 2 } /> : null }
4743 { info }
4844 </ Text >
4945 < Box >
@@ -69,14 +65,3 @@ PackageHeader.propTypes = {
6965 source : PropTypes . string ,
7066 status : PropTypes . string
7167}
72-
73- function getStatusColor ( status ) {
74- return (
75- {
76- stable : 'green.6' ,
77- 'new release' : 'yellow.7' ,
78- deprecated : 'red.7' ,
79- experimental : 'orange.5'
80- } [ status . toLowerCase ( ) ] || 'gray.5'
81- )
82- }
0 commit comments