Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2984 | Rev 3001 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |

import React from 'react'
import { NavigateBefore } from '@mui/icons-material'
import { Box, IconButton, Typography } from '@mui/material'
import { useNavigate } from 'react-router-dom'

export default function GoBackLayout({ title, children }) {
  const navigate = useNavigate()

  const navigateBefore = () => {
    navigate(-1)
  }

  return (
    <>
      <Box
        sx={{
          display: 'flex',
          alignItems: 'center',
          gap: (theme) => theme.spacing(0.5),
          marginBottom: (theme) => theme.spacing(1)
        }}
      >
        <IconButton
          onClick={navigateBefore}
          sx={{ padding: (theme) => theme.spacing(0.3) }}
        >
          <NavigateBefore />
        </IconButton>

        <Typography variant='h1' sx={{ marginBottom: '0' }}>
          {title}
        </Typography>
      </Box>
      {children}
    </>
  )
}