1 import { c } from 'ttag';
3 import { Icon, ToolbarButton } from '@proton/components';
5 import type { DecryptedLink } from '../../../store';
6 import { useLinkSharingModal } from '../../modals/ShareLinkModal/ShareLinkModal';
7 import { isMultiSelect, noSelection } from './utils';
10 selectedLinks: DecryptedLink[];
13 const ShareLinkButton = ({ selectedLinks }: Props) => {
14 const [linkSharingModal, showLinkSharingModal] = useLinkSharingModal();
16 if (noSelection(selectedLinks) || isMultiSelect(selectedLinks)) {
23 disabled={noSelection(selectedLinks) || isMultiSelect(selectedLinks)}
24 title={c('Action').t`Share`}
25 icon={<Icon name="user-plus" alt={c('Action').t`Share`} />}
27 showLinkSharingModal({ shareId: selectedLinks[0].rootShareId, linkId: selectedLinks[0].linkId })
29 data-testid="toolbar-share-link"
36 export default ShareLinkButton;