2021-03-29 22:40:17 +00:00
|
|
|
import { ReactNode } from 'react';
|
2022-02-17 21:01:56 +00:00
|
|
|
import { Box, styled } from '@mui/material';
|
|
|
|
|
2021-05-20 19:21:03 +00:00
|
|
|
import { BORDER_RADIUS, DIVIDER } from '../../lib/consts/DEFAULT_THEME';
|
2021-03-29 22:40:17 +00:00
|
|
|
|
2022-02-17 21:01:56 +00:00
|
|
|
const PREFIX = 'InnerPanelHeader';
|
2022-01-07 19:39:13 +00:00
|
|
|
|
|
|
|
const classes = {
|
|
|
|
header: `${PREFIX}-header`,
|
2021-03-29 22:40:17 +00:00
|
|
|
};
|
|
|
|
|
2022-01-07 19:39:13 +00:00
|
|
|
const StyledBox = styled(Box)(() => ({
|
|
|
|
position: 'relative',
|
|
|
|
padding: '0 .7em',
|
|
|
|
whiteSpace: 'pre-wrap',
|
|
|
|
|
|
|
|
[`& .${classes.header}`]: {
|
2021-04-30 21:48:10 +00:00
|
|
|
top: '-.3em',
|
|
|
|
left: '-.3em',
|
2021-04-30 17:39:28 +00:00
|
|
|
padding: '1.4em 0',
|
2021-04-28 21:48:22 +00:00
|
|
|
position: 'absolute',
|
|
|
|
content: '""',
|
|
|
|
borderColor: DIVIDER,
|
|
|
|
borderWidth: '1px',
|
2021-05-20 19:21:03 +00:00
|
|
|
borderRadius: BORDER_RADIUS,
|
2021-04-28 21:48:22 +00:00
|
|
|
borderStyle: 'solid',
|
|
|
|
width: '100%',
|
2021-03-29 22:40:17 +00:00
|
|
|
},
|
|
|
|
}));
|
|
|
|
|
2022-01-07 19:39:13 +00:00
|
|
|
type Props = {
|
|
|
|
children: ReactNode;
|
|
|
|
};
|
2021-03-29 22:40:17 +00:00
|
|
|
|
2022-02-17 21:01:56 +00:00
|
|
|
const InnerPanelHeader = ({ children }: Props): JSX.Element => {
|
2021-03-29 22:40:17 +00:00
|
|
|
return (
|
2022-01-07 19:39:13 +00:00
|
|
|
<StyledBox>
|
2021-04-28 21:48:22 +00:00
|
|
|
<div className={classes.header} />
|
2021-03-29 22:40:17 +00:00
|
|
|
{children}
|
2022-01-07 19:39:13 +00:00
|
|
|
</StyledBox>
|
2021-03-29 22:40:17 +00:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2022-02-17 21:01:56 +00:00
|
|
|
export default InnerPanelHeader;
|