Skip to content

Commit

Permalink
add-variant-to-text-badge
Browse files Browse the repository at this point in the history
  • Loading branch information
MonPote committed Jun 17, 2024
1 parent 73b6442 commit b58115d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/lib/components/textbadge/TextBadge.component.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
// @ts-nocheck
import styled from 'styled-components';
import { spacing } from '../../spacing';
import { fontWeight } from '../../style/theme';

const StyledTextBadge = styled.span`
type TextBadgeVariant =
| 'statusHealthy'
| 'statusWarning'
| 'statusCritical'
| 'infoPrimary'
| 'infoSecondary'
| 'selectedActive';

const StyledTextBadge = styled.span<{ variant: TextBadgeVariant }>`
${({ theme, variant }) => `
background-color: ${theme[variant]};
color: ${
Expand All @@ -19,12 +26,7 @@ const StyledTextBadge = styled.span`
type Props = {
text: string;
className?: string;
variant?:
| 'statusHealthy'
| 'statusWarning'
| 'statusCritical'
| 'infoPrimary'
| 'infoSecondary';
variant?: TextBadgeVariant;
};
export function TextBadge({
text,
Expand Down

0 comments on commit b58115d

Please sign in to comment.