// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import * as React from "react"; import { Dialog, DialogActions, Button, StyleRulesCallback, WithStyles, withStyles, DialogTitle, DialogContent, Tabs, Tab, DialogContentText } from '@material-ui/core'; import { WithDialogProps } from '~/store/dialog/with-dialog'; import { withDialog } from "~/store/dialog/with-dialog"; import { compose } from 'redux'; import { ADVANCED_TAB_DIALOG } from "~/store/advanced-tab/advanced-tab"; import { DefaultCodeSnippet } from "~/components/default-code-snippet/default-code-snippet"; type CssRules = 'content' | 'codeSnippet' | 'secondContentText'; const styles: StyleRulesCallback = theme => ({ content: { paddingTop: theme.spacing.unit * 3 }, codeSnippet: { borderRadius: theme.spacing.unit * 0.5, border: '1px solid', borderColor: theme.palette.grey["400"] }, secondContentText: { paddingTop: theme.spacing.unit * 2 } }); export const AdvancedTabDialog = compose( withDialog(ADVANCED_TAB_DIALOG), withStyles(styles), )( class extends React.Component & WithStyles>{ state = { value: 0, }; componentDidMount() { this.setState({ value: 0 }); } handleChange = (event: React.MouseEvent, value: number) => { this.setState({ value }); } render() { const { classes, open, closeDialog } = this.props; const { value } = this.state; const { pythonHeader, pythonExample, CLIGetHeader, CLIGetExample, CLIUpdateHeader, CLIUpdateExample, curlHeader, curlExample } = this.props.data; return this.setState({ value: 0 })} > Advanced {value === 0 &&
API CONTENT
} {value === 1 &&
METADATA CONTENT
} {value === 2 &&
{pythonHeader}
} {value === 3 &&
{CLIGetHeader} {CLIUpdateHeader}
} {value === 4 &&
{curlHeader}
}
; } } );