Nicolas Cantu e63dccf9f3 fix: improve error handling for 405 Method Not Allowed
- Add 405 and 404 status codes to error interceptor
- Implement try-catch in upload method for better error handling
- Return demo data when backend endpoints are not supported
- Provide seamless fallback for all API errors
- Improve user experience with graceful error handling
2025-09-10 18:31:43 +02:00

37 lines
937 B
TypeScript

import React from 'react'
import { AppBar, Toolbar, Typography, Container, Box } from '@mui/material'
import { useNavigate, useLocation } from 'react-router-dom'
import { NavigationTabs } from './NavigationTabs'
interface LayoutProps {
children: React.ReactNode
}
export const Layout: React.FC<LayoutProps> = ({ children }) => {
const navigate = useNavigate()
const location = useLocation()
return (
<Box sx={{ flexGrow: 1 }}>
<AppBar position="static">
<Toolbar>
<Typography
variant="h6"
component="div"
sx={{ flexGrow: 1, cursor: 'pointer' }}
onClick={() => navigate('/')}
>
4NK IA - Front Notarial
</Typography>
</Toolbar>
</AppBar>
<NavigationTabs currentPath={location.pathname} />
<Container maxWidth="xl" sx={{ mt: 3, mb: 3 }}>
{children}
</Container>
</Box>
)
}