import React, { useEffect, useState } from 'react'; import Notification from '../../../../ui/components/Notification'; import { usePhone } from '../../../../os/phone/hooks/usePhone'; import { useTranslation } from 'react-i18next'; import useStyles from './notification.style'; import { useBankNotification } from '../../hooks/useBankNotification'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faWonSign } from '@fortawesome/free-solid-svg-icons'; export const BankNotification = () => { const { notification } = useBankNotification(); const classes = useStyles(); const { t } = useTranslation(); const [visible, setVisible] = useState(false); const { config } = usePhone(); useEffect(() => { if (notification && notification.id) { setVisible(true); } }, [notification]); if (!config?.bank.showNotifications || !notification) return null; return ( setVisible(false)} >
{notification.type}
{t('APPS_BANK_TIME_JUST_NOW')}
{notification.source} sent you ${notification.transferAmount}.{' '}

{notification.message}
); };