jobiqo-cl
Version:
[](https://circleci.com/gh/jobiqo/jobiqo-cl)
31 lines (28 loc) • 1.06 kB
JavaScript
import React__default from 'react';
import styled from 'styled-components';
/**
* @file index.tsx
*
* @fileoverview Renders a badge using the styles provided in the theme.
*/
const StyledSpanBadge = styled.span `
background: ${props => props.theme.badge.backgroundColor[props.badgeStyle]};
padding: ${props => props.theme.badge.padding};
border-radius: ${props => props.theme.badge.borderRadius};
font-size: ${props => props.theme.badge.fontSize};
color: ${props => props.theme.badge.color[props.badgeStyle]};
`;
/**
* Badges contain numeric values, like the number of unread messages.
* Use badges to label page items with a small amount of information that help.
* Badges are normally placed before or after the label of the thing they're quantifying
* and contain on.
*/
const Badge = ({ children, badgeStyle }) => {
return React__default.createElement(StyledSpanBadge, { badgeStyle: badgeStyle }, children);
};
Badge.defaultProps = {
badgeStyle: 'primary',
theme: null
};
export { Badge, StyledSpanBadge };