import { Head, Link, router } from '@inertiajs/react'; import { Bell, CheckCheck } from 'lucide-react'; import { PageHeading } from '@/components/page-heading'; import { Button } from '@/components/ui/button'; import { cn } from '@/lib/utils'; import type { Paginated } from '@/types'; type PortalNotification = { id: string; data: { message: string; url?: string; reference?: string; }; read_at: string | null; created_at: string; }; export default function NotificationsIndex({ notifications, }: { notifications: Paginated; }) { function openNotification(notification: PortalNotification) { router.post(`/notificacoes/${notification.id}/ler`); } return ( <>
router.post('/notificacoes/ler-todas') } > Marcar todas como lidas } />
{notifications.data.map((notification) => ( ))} {notifications.data.length === 0 && (
Não existem notificações.
)}
{notifications.last_page > 1 && ( )}
); } NotificationsIndex.layout = { breadcrumbs: [{ title: 'Notificações', href: '/notificacoes' }], };