diff --git a/src/app/components/RecentPayee.tsx/RecentPayee.tsx b/src/app/components/RecentPayee.tsx/RecentPayee.tsx index 2b63878..a707f59 100644 --- a/src/app/components/RecentPayee.tsx/RecentPayee.tsx +++ b/src/app/components/RecentPayee.tsx/RecentPayee.tsx @@ -12,15 +12,62 @@ import Link from 'next/link'; import truncateEthAddress from 'truncate-eth-address'; // components import { Avatar } from '@/app/components/ui/avatar'; +// alchemy import { AssetTransfersResponse } from 'alchemy-sdk'; +// hooks import useGetAddress from '@/app/hooks/useGetAddress'; +// card import { Card, CardContent, CardHeader } from '../ui/card'; +// redux +import { useSelector } from 'react-redux'; +import { RootState } from '@/GlobalRedux/store'; + import { Contact } from '@/app/types/types'; + + function Payee ({payee, contactsState} : {payee: string, payees: any, contactsState: Contact[]}) { + + // Find the contact in contactsState array with matching address + const matchedContact = contactsState.find((contact: Contact) => contact.address === payee); + + // If a matching contact is found, use its name, otherwise use truncated payee address + const payeeName = matchedContact ? matchedContact.name : truncateEthAddress(payee); + + return ( + <> +