feat: complete approval workflow

This commit is contained in:
2026-08-04 16:51:51 +01:00
parent c2136bc250
commit 809eab9d4a
26 changed files with 1156 additions and 41 deletions

View File

@@ -1,5 +1,6 @@
import { Link, usePage } from '@inertiajs/react';
import {
Bell,
CalendarDays,
CalendarRange,
LayoutGrid,
@@ -42,6 +43,7 @@ const mainNavItems: NavItem[] = [
href: '/requisicoes/calendario',
icon: CalendarRange,
},
{ title: 'Notificações', href: '/notificacoes', icon: Bell },
];
const footerNavItems: NavItem[] = [
@@ -53,17 +55,22 @@ const footerNavItems: NavItem[] = [
];
export function AppSidebar() {
const { can } = usePage().props;
const { can, unreadNotifications } = usePage().props;
const userNavItems = mainNavItems.map((item) =>
item.href === '/notificacoes' && unreadNotifications > 0
? { ...item, title: `Notificações (${unreadNotifications})` }
: item,
);
const roleNavItems = can.approveReservations
? [
...mainNavItems,
...userNavItems,
{
title: 'Aprovações',
href: '/aprovacoes',
icon: ListChecks,
},
]
: mainNavItems;
: userNavItems;
const visibleNavItems = can.administer
? [
...roleNavItems,