Rev 2798 | Rev 2919 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
import React from 'react'
import { Button, styled, Typography } from '@mui/material'
import { Add } from '@mui/icons-material'
const Header = styled('div')(({ theme }) => ({
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
position: 'relative',
marginBottom: theme.spacing(1),
[theme.breakpoints.up('md')]: {
justifyContent: 'center',
button: {
position: 'absolute',
right: 0,
top: '50%',
transform: 'translateY(-50%)'
}
}
}))
const TitleSection = ({ onAdd, addLabel = '', title = '', ...rest }) => {
return (
<Header {...rest}>
<Typography variant='h1' sx={{ fontSize: '1.1rem' }}>
{title}
</Typography>
{onAdd && (
<Button onClick={onAdd}>
<Add />
{addLabel}
</Button>
)}
</Header>
)
}
export default TitleSection