Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / applications / drive / src / app / components / SharedPage / Layout / ClosePartialPublicViewButton.tsx
blob7c84fa1ae6391790c1111fbe95b937afabc23654
1 import { c } from 'ttag';
3 import { Button } from '@proton/atoms';
4 import { Icon } from '@proton/components';
5 import { getAppHref } from '@proton/shared/lib/apps/helper';
6 import { APPS } from '@proton/shared/lib/constants';
8 import { usePublicSessionUser } from '../../../store';
10 interface Props {
11     className?: string;
13 export const ClosePartialPublicViewButton = ({ className }: Props) => {
14     const { localID } = usePublicSessionUser();
15     const handleClosePartialPublicView = () => {
16         const sharedWithMeUrl = getAppHref('/shared-with-me', APPS.PROTONDRIVE, localID);
17         window.location.assign(sharedWithMeUrl);
18     };
19     return (
20         <Button
21             icon
22             className={className}
23             shape="ghost"
24             title={c('Action').t`Close`}
25             onClick={handleClosePartialPublicView}
26             data-testid="public-preview:button:close"
27         >
28             <Icon name="cross-big" />
29         </Button>
30     );