18 lines
613 B
TypeScript
18 lines
613 B
TypeScript
import React from 'react';
|
|
import { View, Text } from 'react-native';
|
|
import { BadgeProps } from './badge.props';
|
|
import { getStyles, getVariantStyle } from './badge.styles';
|
|
import { useAppTheme } from '@theme';
|
|
|
|
export const Badge: React.FC<BadgeProps> = ({ text, variant = 'primary' }) => {
|
|
const { colors } = useAppTheme();
|
|
const styles = getStyles();
|
|
const variantStyle = getVariantStyle(colors, variant);
|
|
|
|
return (
|
|
<View style={[styles.badge, { backgroundColor: variantStyle.backgroundColor }]}>
|
|
<Text style={[styles.text, { color: variantStyle.color }]}>{text}</Text>
|
|
</View>
|
|
);
|
|
};
|