1 import { type FC } from 'react';
2 import { useSelector } from 'react-redux';
4 import { c, msgid } from 'ttag';
6 import { Button } from '@proton/atoms';
7 import { usePassCore } from '@proton/pass/components/Core/PassCoreProvider';
8 import type { BaseSpotlightMessage } from '@proton/pass/components/Spotlight/SpotlightContent';
9 import { AliasSyncIcon } from '@proton/pass/components/Spotlight/SpotlightIcon';
10 import { selectUserData } from '@proton/pass/store/selectors';
11 import { pipe } from '@proton/pass/utils/fp/pipe';
12 import { PASS_APP_NAME } from '@proton/shared/lib/constants';
13 import noop from '@proton/utils/noop';
15 export const AliasSync: FC<BaseSpotlightMessage> = ({ onClose = noop }) => {
16 const { openSettings } = usePassCore();
17 const { pendingAliasToSync: aliasCount } = useSelector(selectUserData);
21 <div className="flex-1">
22 <strong className="block color-invert">{c('Title').t`Sync your aliases from SimpleLogin`}</strong>
23 <span className="block text-sm color-invert">
25 msgid`You have ${aliasCount} alias that is present in SimpleLogin but missing in ${PASS_APP_NAME}. Would you like to sync it?`,
26 `You have ${aliasCount} aliases that are present in SimpleLogin but missing in ${PASS_APP_NAME}. Would you like to sync them?`,
30 <div className="mt-2">
36 className="text-sm px-3"
37 onClick={pipe(onClose, () => openSettings?.('aliases'))}
38 style={{ backgroundColor: 'var(--interaction-norm-major-3)' }}
40 {c('Action').ngettext(msgid`Sync alias`, `Sync aliases`, aliasCount)}
45 <div className="mr-2">