Merge remote-tracking branch 'origin/main' into 19051-handle-quotes-in-search
[arvados.git] / src / views-components / context-menu / actions / file-viewer-action.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import React from "react";
6 import { ListItemIcon, ListItemText, ListItem } from "@material-ui/core";
7 import { OpenIcon } from "components/icon/icon";
8
9 export const FileViewerAction = (props: any) => {
10     return props.href
11         ? <a
12             style={{ textDecoration: 'none' }}
13             href={props.href}
14             target="_blank"
15             rel="noopener noreferrer"
16             onClick={props.onClick}>
17             <ListItem button>
18                 <ListItemIcon>
19                     <OpenIcon />
20                 </ListItemIcon>
21                 <ListItemText>
22                     Open in new tab
23                     </ListItemText>
24             </ListItem>
25         </a>
26         : null;
27 };