You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
880 B
45 lines
880 B
4 years ago
|
import { ReactNode } from 'react';
|
||
3 years ago
|
import { Box, styled } from '@mui/material';
|
||
|
|
||
4 years ago
|
import { BORDER_RADIUS, DIVIDER } from '../../lib/consts/DEFAULT_THEME';
|
||
4 years ago
|
|
||
3 years ago
|
const PREFIX = 'InnerPanelHeader';
|
||
3 years ago
|
|
||
|
const classes = {
|
||
|
header: `${PREFIX}-header`,
|
||
4 years ago
|
};
|
||
|
|
||
3 years ago
|
const StyledBox = styled(Box)(() => ({
|
||
|
position: 'relative',
|
||
|
padding: '0 .7em',
|
||
|
whiteSpace: 'pre-wrap',
|
||
|
|
||
|
[`& .${classes.header}`]: {
|
||
4 years ago
|
top: '-.3em',
|
||
|
left: '-.3em',
|
||
4 years ago
|
padding: '1.4em 0',
|
||
4 years ago
|
position: 'absolute',
|
||
|
content: '""',
|
||
|
borderColor: DIVIDER,
|
||
|
borderWidth: '1px',
|
||
4 years ago
|
borderRadius: BORDER_RADIUS,
|
||
4 years ago
|
borderStyle: 'solid',
|
||
|
width: '100%',
|
||
4 years ago
|
},
|
||
|
}));
|
||
|
|
||
3 years ago
|
type Props = {
|
||
|
children: ReactNode;
|
||
|
};
|
||
4 years ago
|
|
||
3 years ago
|
const InnerPanelHeader = ({ children }: Props): JSX.Element => {
|
||
4 years ago
|
return (
|
||
3 years ago
|
<StyledBox>
|
||
4 years ago
|
<div className={classes.header} />
|
||
4 years ago
|
{children}
|
||
3 years ago
|
</StyledBox>
|
||
4 years ago
|
);
|
||
|
};
|
||
|
|
||
3 years ago
|
export default InnerPanelHeader;
|