This commit is contained in:
11
05_react/uebungen/u08_badge-2/src/components/Badge.jsx
Normal file
11
05_react/uebungen/u08_badge-2/src/components/Badge.jsx
Normal file
@@ -0,0 +1,11 @@
|
||||
const Badge = (props) => {
|
||||
const { text = '', variant = 'secondary', color = '' } = props;
|
||||
|
||||
return (
|
||||
<span className={`badge ${!color ? `text-bg-${variant}` : ''} mx-1`} style={{ backgroundColor: color }}>
|
||||
{text}
|
||||
</span>
|
||||
);
|
||||
// <span className={`badge text-bg-${variant}`}>{text};</span>
|
||||
};
|
||||
export default Badge;
|
||||
Reference in New Issue
Block a user