Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / packages / components / hooks / recoveryFile / useIsRecoveryFileAvailable.ts
bloba0c3931cb323fade5b89dcd5bc40b79b4c403fd3
1 import { useAddresses } from '@proton/account/addresses/hooks';
2 import { useUser } from '@proton/account/user/hooks';
3 import { useUserKeys } from '@proton/account/userKeys/hooks';
4 import { getIsRecoveryFileAvailable } from '@proton/shared/lib/recoveryFile/recoveryFile';
6 import useConfig from '../useConfig';
8 const useIsRecoveryFileAvailable = () => {
9     const [user, loadingUser] = useUser();
10     const [addresses = [], loadingAddresses] = useAddresses();
11     const [userKeys = [], loadingUserKeys] = useUserKeys();
12     const { APP_NAME } = useConfig();
14     const isRecoveryFileAvailable = getIsRecoveryFileAvailable({
15         user,
16         addresses,
17         userKeys,
18         appName: APP_NAME,
19     });
21     return [isRecoveryFileAvailable, loadingUserKeys || loadingAddresses || loadingUser] as const;
24 export default useIsRecoveryFileAvailable;