import React, { FC } from 'react'; import { CheckCircle, Warning, XCircle } from 'phosphor-react-native'; import type { AlertTypes } from './alert'; import { colors } from '../../theme/theme'; import { Box } from '../Box'; interface IProps { icon?: JSX.Element; type?: AlertTypes; size?: number; } export type TIcon = { [icon in AlertTypes]: JSX.Element; }; const renderIcon: TIcon = { success: , danger: , warning: , action: , }; export const Icon: FC = ({ icon, type, size }) => { return ( {icon} {type && !icon && renderIcon[type]} ); };