Skip to content

Instantly share code, notes, and snippets.

@jasonleehodges
Last active July 18, 2021 20:22
Show Gist options
  • Save jasonleehodges/5baa769e79873875ded66b856ddac731 to your computer and use it in GitHub Desktop.
Save jasonleehodges/5baa769e79873875ded66b856ddac731 to your computer and use it in GitHub Desktop.
import React from 'react';
import { status, labels } from './status';
export const Badge = (props) => {
return (
<div style={
{backgroundColor: props.status === status.active ? 'green' : 'red'}
}>
{labels.statusPrompt[props.language]}: {props.status}
</div>
);
};
export const status = {
active: 'Ready',
inactive: 'Inactive'
}
export const labels = {
statusPrompt: {
'en-US': 'Status',
'fr-FR': 'Statut',
},
welcomeMessage: {
'en-US': 'Welcome to this website!',
'fr-FR': 'Bienvenue sur ce site!',
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment