1 import { c } from 'ttag';
3 import { FloatingButton, Icon, SidebarPrimaryButton } from '@proton/components';
5 import useActiveShare from '../../../hooks/drive/useActiveShare';
6 import { useFileSharingModal } from '../../modals/SelectLinkToShareModal/SelectLinkToShareModal';
7 import { useLinkSharingModal } from '../../modals/ShareLinkModal/ShareLinkModal';
10 mobileVersion?: boolean;
13 const ShareFileSidebarButton = ({ mobileVersion }: Props) => {
14 const { activeShareId } = useActiveShare();
15 const [fileSharingModal, showFileSharingModal] = useFileSharingModal();
16 const [linkSharingModal, showLinkSharingModal] = useLinkSharingModal();
18 const onShareFile = () => {
20 void showFileSharingModal({ shareId: activeShareId, showLinkSharingModal });
27 <FloatingButton onClick={onShareFile} title={c('Action').t`Share item`} disabled={!activeShareId}>
28 <Icon size={6} name="link" className="m-auto" />
31 <SidebarPrimaryButton className="hidden md:flex" disabled={!activeShareId} onClick={onShareFile}>
32 {c('Action').t`Share item`}
33 </SidebarPrimaryButton>
41 export default ShareFileSidebarButton;