1 import { useAuthStore } from '@proton/pass//components/Core/AuthStoreProvider';
2 import { usePassCore } from '@proton/pass/components/Core/PassCoreProvider';
3 import type { AccountPath } from '@proton/pass/constants';
5 export const useNavigateToAccount = (path: AccountPath) => {
6 const { onLink, config } = usePassCore();
7 const authStore = useAuthStore();
9 const localID = authStore?.getLocalID();
10 const localIdPath = localID !== undefined ? `u/${localID}/` : '';
12 const href = `${config.SSO_URL}/${localIdPath}${path}`;
14 return () => onLink(href);