12 lines
342 B
TypeScript
12 lines
342 B
TypeScript
import { useMemo } from 'react'
|
|
|
|
import useAccount from 'hooks/accounts/useAccount'
|
|
import useAccountId from 'hooks/useAccountId'
|
|
|
|
export default function useCurrentAccount(): Account | undefined {
|
|
const accountId = useAccountId()
|
|
const { data: account } = useAccount(accountId || undefined)
|
|
|
|
return useMemo(() => account, [account])
|
|
}
|