Last active
July 11, 2021 22:33
-
-
Save jasonleehodges/350fc89250e2a4f13dbac89858f02127 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
export const status = { | |
active: 'Ready', | |
inactive: 'Inactive' | |
} |
This file contains hidden or 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
import React from 'react'; | |
import { status } from './status'; | |
export const Badge = (props) => { | |
return ( | |
<div style={ | |
{backgroundColor: props.status === status.active ? 'green' : 'red'} | |
}> | |
Status: {props.status} | |
</div> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment