22083: Store "failedToLoadOutputCollection" state
[arvados.git] / services / workbench2 / src / components / code-snippet / code-snippet.tsx
index 47d8fe1bf029bc5915a069c4a2c12dd08c8051b4..fd618654d9f70cf49687620d620e3f6a76f8a2eb 100644 (file)
@@ -3,7 +3,10 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import React from 'react';
-import { StyleRulesCallback, WithStyles, Typography, withStyles, Link } from '@material-ui/core';
+import { CustomStyleRulesCallback } from 'common/custom-theme';
+import { Typography, Link } from '@mui/material';
+import { WithStyles } from '@mui/styles';
+import withStyles from '@mui/styles/withStyles';
 import { ArvadosTheme } from 'common/custom-theme';
 import classNames from 'classnames';
 import { connect, DispatchProp } from 'react-redux';
@@ -14,11 +17,11 @@ import { navigationNotAvailable } from 'store/navigation/navigation-action';
 
 type CssRules = 'root' | 'inlineRoot' | 'space' | 'inline';
 
-const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+const styles: CustomStyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     root: {
         boxSizing: 'border-box',
         overflow: 'auto',
-        padding: theme.spacing.unit,
+        padding: theme.spacing(1),
     },
     inlineRoot: {
         padding: "3px",
@@ -66,7 +69,7 @@ export const CodeSnippet = withStyles(styles)(connect(mapStateToProps)(
         </Typography>
 ));
 
-const renderLinks = (auth: FederationConfig, dispatch: Dispatch) => (text: string): JSX.Element => {
+export const renderLinks = (auth: FederationConfig, dispatch: Dispatch) => (text: string): JSX.Element => {
     // Matches UUIDs & PDHs
     const REGEX = /[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15}|[0-9a-f]{32}\+\d+/g;
     const links = text.match(REGEX);