2 // Copyright (C) The Arvados Authors. All rights reserved.
4 // SPDX-License-Identifier: AGPL-3.0
6 import React from 'react';
7 import classNames from 'classnames';
8 import { withRouter, RouteComponentProps } from 'react-router';
9 import { CustomStyleRulesCallback } from 'common/custom-theme';
10 import { Button } from "@mui/material";
11 import { WithStyles } from '@mui/styles';
12 import withStyles from '@mui/styles/withStyles';
13 import { ReRunProcessIcon } from 'components/icon/icon';
15 type CssRules = 'button' | 'buttonRight';
17 const styles: CustomStyleRulesCallback<CssRules> = theme => ({
20 padding: '2px 10px 2px 5px',
28 interface RefreshButtonProps {
32 export const LAST_REFRESH_TIMESTAMP = 'lastRefreshTimestamp';
34 export const RefreshButton = ({ history, classes, onClick }: RouteComponentProps & WithStyles<CssRules> & RefreshButtonProps) =>
40 // Notify interested parties that the refresh button was clicked.
41 const now = (new Date()).getTime();
42 localStorage.setItem(LAST_REFRESH_TIMESTAMP, now.toString());
43 history.replace(window.location.pathname);
48 className={classNames(classes.buttonRight, classes.button)}>
53 export default withStyles(styles)(withRouter(RefreshButton));