1 import { useAddresses } from '@proton/account/addresses/hooks';
2 import { useUser } from '@proton/account/user/hooks';
3 import { getIsMnemonicAvailable } from '@proton/shared/lib/mnemonic';
5 import useConfig from './useConfig';
7 const useIsMnemonicAvailable = () => {
8 const { APP_NAME } = useConfig();
9 const [user, loadingUser] = useUser();
10 const [addresses = [], loadingAddresses] = useAddresses();
12 const isMnemonicAvailable = getIsMnemonicAvailable({ addresses, user, app: APP_NAME });
14 return [isMnemonicAvailable, loadingAddresses || loadingUser] as const;
17 export default useIsMnemonicAvailable;