import TableFilter from '@/components/table/table-filter'; import TableFooter from '@/components/table/table-footer'; import { Button } from '@/components/ui/button'; import { Card } from '@/components/ui/card'; import LandingLayout from '@/layouts/landing-layout'; import { cn } from '@/lib/utils'; import { Link, router } from '@inertiajs/react'; import { format, formatDistanceToNow } from 'date-fns'; import { ReactNode } from 'react'; const Index = ({ notifications, translate }: { notifications: Pagination; translate: any }) => { const { button, frontend } = translate; return (
{notifications.total > 0 && ( )}
{notifications.data.length > 0 ? ( notifications.data.map(({ id, data, created_at }) => { const time = formatDistanceToNow(new Date(created_at), { addSuffix: true }); const timeText = time.slice(0, 1).toUpperCase() + time.slice(1); return (

{data.title}

{timeText} ); }) ) : (

{frontend.no_unread_notifications}

)}
); }; Index.layout = (page: ReactNode) => ; export default Index;