2 * ============LICENSE_START========================================================================
3 * ONAP : ccsdk feature sdnr wt odlux
4 * =================================================================================================
5 * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
6 * =================================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8 * in compliance with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software distributed under the License
13 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14 * or implied. See the License for the specific language governing permissions and limitations under
16 * ============LICENSE_END==========================================================================
18 import * as React from 'react';
20 import { Theme } from '@mui/material/styles';
22 import { WithStyles } from '@mui/styles';
23 import withStyles from '@mui/styles/withStyles';
24 import createStyles from '@mui/styles/createStyles';
26 import { Accordion, AccordionSummary, AccordionDetails, Typography, AccordionActions } from '@mui/material';
28 import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
29 import { SvgIconProps } from '@mui/material/SvgIcon';
31 const styles = (theme: Theme) => createStyles({
33 // background: theme.palette.secondary.dark,
34 // color: theme.palette.primary.contrastText
37 // background: theme.palette.background.paper,
38 // color: theme.palette.text.primary,
40 flexDirection: 'column'
43 // color: theme.palette.common.white,
48 type PanalProps = WithStyles<typeof styles> & {
49 activePanel: string | null,
52 customActionButtons?: JSX.Element[];
53 onToggle: (panelId: string | null) => void;
56 const PanelComponent: React.SFC<PanalProps> = (props) => {
57 const { classes, activePanel, onToggle } = props;
59 <Accordion className={classes.accordion} expanded={activePanel === props.panelId} onChange={() => onToggle(props.panelId)} >
60 <AccordionSummary expandIcon={<ExpandMoreIcon />}>
61 <Typography className={classes.text} >{props.title}</Typography>
63 <AccordionDetails className={classes.detail}>
66 {props.customActionButtons
68 {props.customActionButtons}
75 export const Panel = withStyles(styles)(PanelComponent);