import { Button, Notification } from 'components/common' import { useRouter } from 'next/router' import React from 'react' import { useTranslation } from 'react-i18next' import useStore from 'store' import { NotificationType } from 'types/enums' import styles from './UnlockedNotification.module.scss' export const UnlockedNotification = () => { const router = useRouter() const { t } = useTranslation() const activeVaults = useStore((s) => s.activeVaults) const vaultsUnlocked = activeVaults.filter( (activeVault) => activeVault && activeVault.position.status === 'unlocked' && activeVault.position.id, ) if (!vaultsUnlocked.length) return null const exitVaultHandler = () => { router.push( `/farm/vault/${vaultsUnlocked[0].address}/account/${vaultsUnlocked[0].position.accountId}/close`, ) } const unlockedContent = () => { if (vaultsUnlocked.length === 1) { return (
{t('fields.notifications.unlocked.single.text', { lp: vaultsUnlocked[0].name.name, })}
) } else { return (
{t('fields.notifications.unlocked.plural')}
) } } return ( ) }