1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import Drawer from '@material-ui/core/Drawer';
7 import IconButton from "@material-ui/core/IconButton";
8 import CloseIcon from '@material-ui/icons/Close';
9 import FolderIcon from '@material-ui/icons/Folder';
10 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
11 import { ArvadosTheme } from '../../common/custom-theme';
12 import Attribute from '../../components/attribute/attribute';
13 import Tabs from '@material-ui/core/Tabs';
14 import Tab from '@material-ui/core/Tab';
15 import Typography from '@material-ui/core/Typography';
16 import Grid from '@material-ui/core/Grid';
17 import * as classnames from "classnames";
19 export interface DetailsPanelProps {
20 onCloseDrawer: () => void;
24 class DetailsPanel extends React.Component<DetailsPanelProps & WithStyles<CssRules>, {}> {
29 handleChange = (event: any, value: boolean) => {
30 this.setState({ tabsValue: value });
33 renderTabContainer = (children: React.ReactElement<any>) =>
34 <Typography className={this.props.classes.tabContainer} component="div">
39 const { classes, onCloseDrawer, isOpened } = this.props;
40 const { tabsValue } = this.state;
42 <div className={classnames([classes.container, { [classes.opened]: isOpened }])}>
43 <Drawer variant="permanent" anchor="right" classes={{ paper: classes.drawerPaper }}>
44 <Typography component="div" className={classes.headerContainer}>
45 <Grid container alignItems='center' justify='space-around'>
46 <i className="fas fa-cogs fa-lg" />
47 <Typography variant="title">
50 <IconButton color="inherit" onClick={onCloseDrawer}>
55 <Tabs value={tabsValue} onChange={this.handleChange}>
56 <Tab disableRipple label="Details" />
57 <Tab disableRipple label="Activity" />
59 {tabsValue === 0 && this.renderTabContainer(
60 <Grid container direction="column">
61 <Attribute label="Type">Process</Attribute>
62 <Attribute label="Size">---</Attribute>
63 <Attribute label="Location">
67 <Attribute label="Owner">me</Attribute>
70 {tabsValue === 1 && this.renderTabContainer(
71 <Grid container direction="column">
72 <Attribute label="Type">Process</Attribute>
73 <Attribute label="Size">---</Attribute>
74 <Attribute label="Location">
78 <Attribute label="Owner">me</Attribute>
88 type CssRules = 'drawerPaper' | 'container' | 'opened' | 'headerContainer' | 'tabContainer';
90 const drawerWidth = 320;
91 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
96 transition: 'width 0.5s ease',
103 position: 'relative',
107 color: theme.palette.grey["600"],
108 margin: `${theme.spacing.unit}px 0`,
111 color: theme.customs.colors.green700
115 padding: theme.spacing.unit * 3
119 export default withStyles(styles)(DetailsPanel);