import * as React from 'react'; import {TouchableOpacity, View} from 'react-native'; import {TailwindFn} from 'twrnc'; import {Style} from 'twrnc/dist/esm/types'; import Image from '../Image'; import Icon from './icon'; type Props = { tw: TailwindFn; style?: Style; badgeStyle?: Style; badgeColor?: string; icon?: string; iconStyle?: Style; iconColor?: string; showBadge?: boolean; size?: number; onPress?: () => void; accessibilityLabel: string; }; const NotificationBadge = ({ tw, style, badgeStyle, badgeColor = '#EF4444', icon, iconStyle, iconColor, showBadge = false, size = 40, onPress, accessibilityLabel, }: Props) => { icon = icon || Icon({color: iconColor}); const defaultStyle = tw`rounded-full w-[${size}px] h-[${size}px] border border-gray-200 bg-gray-100`; const iconDefaultStyle = tw`items-center justify-center h-full`; const badgeDefaultStyle = tw`w-full h-full absolute`; return ( {showBadge && ( )} ); }; export default NotificationBadge;