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