1 import { type FC } from 'react';
2 import { useSelector } from 'react-redux';
4 import { c } from 'ttag';
6 import { DropdownMenuButton } from '@proton/pass/components/Layout/Dropdown/DropdownMenuButton';
7 import { QuickActionsDropdown } from '@proton/pass/components/Layout/Dropdown/QuickActionsDropdown';
8 import { useRequest } from '@proton/pass/hooks/useActionRequest';
9 import { secureLinksRemoveInactive } from '@proton/pass/store/actions';
10 import { selectInactiveSecureLinks } from '@proton/pass/store/selectors';
12 export const SecureLinkQuickActions: FC = () => {
13 const inactiveLinkCount = useSelector(selectInactiveSecureLinks).length;
14 const { loading, dispatch } = useRequest(secureLinksRemoveInactive, { initial: true });
17 <QuickActionsDropdown iconSize={4} originalPlacement="bottom-end" pill shape="ghost" size="small">
21 disabled={inactiveLinkCount === 0 || loading}
22 onClick={() => dispatch()}
25 ? c('Action').t`Remove all expired links (${inactiveLinkCount})`
26 : c('Action').t`No expired links`
32 </QuickActionsDropdown>