-
Notifications
You must be signed in to change notification settings - Fork 977
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
694cfae
commit b352cf4
Showing
3 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,33 @@ | ||
import React from 'react' | ||
import styles from './styles.module.css'; | ||
|
||
const statusColors = { | ||
enterprise: '#727d91', | ||
team: '#727d91', | ||
developer: '#727d91', | ||
new: '#047377', | ||
beta: '#047377', | ||
ga: '#047377', | ||
'public preview': '#047377', | ||
}; | ||
|
||
export default function Lifecycle(props) { | ||
if (!props.status) { | ||
return null; | ||
} | ||
return ( | ||
<span className={styles.lifecycle}>{props.status}</span> | ||
); | ||
// Check if props.status is an array or a single value | ||
const statuses = Array.isArray(props.status) ? props.status : [props.status]; | ||
|
||
return ( | ||
<> | ||
{statuses.map((status, index) => { | ||
const style = { | ||
backgroundColor: props.backgroundColor || statusColors[status] || '#047377' // Default to teal if no match | ||
}; | ||
|
||
return ( | ||
<span key={index} className={styles.lifecycle} style={style}> | ||
{status} | ||
</span> | ||
); | ||
})} | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters