mars-v2-frontend/src/hooks/useCurrentAccount.tsx

10 lines
291 B
TypeScript
Raw Normal View History

import useAccountId from 'hooks/useAccountId'
import useStore from 'store'
export default function useCurrentAccount(): Account | undefined {
const accountId = useAccountId()
const accounts = useStore((s) => s.accounts)
return accounts?.find((account) => account.id === accountId)
}