Layout Components
Layout components provide the structural foundation for the GIMA application, including navigation, headers, and page layouts.Sidebar
Collapsible navigation sidebar with menu items and logo.Description
TheSidebar component provides a responsive, collapsible navigation menu with:
- Animated expand/collapse functionality
- Active route highlighting
- Icon-based navigation items
- Logout functionality
- Logo display
Props
This component does not accept any props. It uses internal state management.Internal State
Controls whether the sidebar is expanded or collapsed
Menu Items Structure
The sidebar renders these navigation items:| Icon | Label | Route |
|---|---|---|
| LayoutDashboard | Dashboard | /dashboard |
| Box | Activos | /categorias-activos |
| Wrench | Mantenimiento | /mantenimiento |
| ClipboardList | Reportes | /reportes |
| Settings | Configuración | /configuracion |
Usage Example
Styling
- Base color:
#001F3F(dark blue) - Width:
w-64when open,w-20when collapsed - Active state: White background with shadow
- Rounded corners on right side
DashboardHeader
Page header with title, search, notifications, and user actions.Description
Displays a contextual page header that automatically generates the title from the current route pathname.Props
Optional subtitle text displayed below the page title
TypeScript Interface
Features
- Auto-generated Title: Extracts and capitalizes route name from pathname
- Search Bar: Input field for searching assets
- Notifications: Bell icon with red dot indicator
- User Profile: User icon button
Usage Example
Default Behavior
If you’re on/dashboard/assets, the header will display “Assets” as the title.
Header
Alternative header component with sidebar toggle for mobile.Description
A simpler header variant that includes mobile sidebar toggle functionality and breadcrumb-style navigation display.Props
This component does not accept any props. It uses theuseSidebar hook for state management.
Features
- Mobile Toggle: Hamburger menu for small screens
- Breadcrumb Display: Shows navigation path
- Search Bar: Desktop-only search input
- Notifications: Bell icon with animated pulse
- User Profile: Circle user icon
Usage Example
Dependencies
RequiresSidebarProvider context wrapper to function properly.
MainLayout
Root layout wrapper that conditionally renders sidebar based on route.Description
The main application layout wrapper that:- Conditionally shows/hides sidebar based on route
- Provides SidebarProvider context
- Sets up flex layout with overflow handling
Props
Child components to render within the layout
TypeScript Interface
Behavior
- Hides sidebar on routes starting with
/auth - Full-height layout with scroll handling
- Gray background (
bg-gray-50) - Padding on main content area
Usage Example
Route Detection
The component uses Next.jsusePathname() to detect auth routes: