mars-v2-frontend/src/hooks/useCurrentAccount.tsx
Bob van der Helm 50fd39e926
Mp 3412 (#487)
* first iteration

* finish implementation

* finish

* fix pr comments

* fix: added Card Title to Overview

---------

Co-authored-by: Linkie Link <linkielink.dev@gmail.com>
2023-09-19 15:39:14 +02:00

10 lines
291 B
TypeScript

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)
}