import React, { FC } from "react"; import { Ionicons, AntDesign } from "@expo/vector-icons"; import { Text, View } from "react-native"; type IconName = string; type IconType = "Ionicons" | "AntDesign"; export const initIcon = ( name: IconName, type: IconType, tabBarBadge?: string, isInfo?: boolean ) => { const IconComponent = type == "Ionicons" ? Ionicons : AntDesign; return ({ focused, color, size }) => ( <> {!!tabBarBadge && } ); }; type BadgeProps = { tabBarBadge: string; isInfo: boolean }; export const Badge: FC = ({ tabBarBadge, isInfo }) => { return ( {tabBarBadge} ); };