Skip to content

Commit

Permalink
update lifecycle component to accept strings + commas (#4919)
Browse files Browse the repository at this point in the history
this pr quickly updates the lifcycle pill so that we can use the
lifecycle pill without the curly brackets (`### test <Lifecycle
status="team,enterprise"/>`)

and updated the lifecycle code to check if the status is a string and
accept strings separated by commands (without curly brackets).
  • Loading branch information
JKarlavige authored Feb 14, 2024
2 parents 9cd4d3d + a587301 commit 35bd14c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions website/src/components/lifeCycle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ const fontColors = {
};

export default function Lifecycle(props) {
if (!props.status || (Array.isArray(props.status) && props.status.length === 0)) {
const statuses = props.status?.split(',')
if (!props.status || !statuses?.length) {
return null;
}
// Check if props.status is an array or a single value
const statuses = Array.isArray(props.status) ? props.status : [props.status];

return (
<>
Expand Down

0 comments on commit 35bd14c

Please sign in to comment.