1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from "react";
6 import { connect } from 'react-redux';
7 import { ListItemIcon, ListItemText, ListItem } from "@material-ui/core";
8 import { OpenIcon } from "~/components/icon/icon";
9 import { sanitizeToken } from "./helpers";
10 import { RootState } from "~/store/store";
12 export const FileViewerAction = (props: any) => {
15 keepWebInlineServiceUrl,
20 style={{ textDecoration: 'none' }}
21 href={sanitizeToken(props.href.replace(keepWebServiceUrl, keepWebInlineServiceUrl), true)}
23 onClick={props.onClick}>
36 const mapStateToProps = ({ auth }: RootState): any => ({
37 keepWebServiceUrl: auth.config.keepWebServiceUrl,
38 keepWebInlineServiceUrl: auth.config.keepWebInlineServiceUrl,
42 export default connect(mapStateToProps, null)(FileViewerAction);