Files
2026-09-01 07:49:48 -03:00

72 lines
2.9 KiB
PHP

@extends('layouts.app')
@section('title', __('Notifications'))
@section('header')
<div class="flex justify-between items-center">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{ __('Notifications') }}
</h2>
<div class="flex items-center gap-4">
<x-language-selector variant="text-gray-600 hover:text-gray-800" />
</div>
</div>
@endsection
@section('content')
<div class="py-6">
<div class="max-w-4xl mx-auto sm:px-6 lg:px-8">
<div class="flex justify-between items-center mb-6">
<h1 class="text-2xl font-bold text-gray-900">{{ __('Notifications') }}</h1>
@if($notifications->total() > 0)
<form action="{{ route('notifications.read-all') }}" method="POST">
@csrf
<button type="submit" class="text-sm text-indigo-600 hover:text-indigo-800">
{{ __('Mark all as read') }}
</button>
</form>
@endif
</div>
<div class="bg-white rounded-xl shadow-sm border border-gray-100">
@forelse($notifications as $notification)
<div class="flex items-start gap-4 p-4 border-b border-gray-100 last:border-0 {{ $notification->is_read ? 'bg-gray-50' : 'bg-white' }}">
<div class="text-2xl">
{{ $notification->typeIcon() }}
</div>
<div class="flex-1 min-w-0">
<div class="flex items-center justify-between">
<h3 class="text-sm font-semibold text-gray-900">
{{ $notification->title }}
</h3>
<span class="text-xs text-gray-400">
{{ $notification->created_at->diffForHumans() }}
</span>
</div>
<p class="text-sm text-gray-600 mt-1">
{{ $notification->message }}
</p>
@if(!$notification->is_read)
<form action="{{ route('notifications.read', $notification) }}" method="POST" class="mt-2">
@csrf
<button type="submit" class="text-xs text-indigo-600 hover:text-indigo-800">
{{ __('Mark as read') }}
</button>
</form>
@endif
</div>
</div>
@empty
<div class="p-8 text-center text-gray-500">
{{ __('No notifications yet.') }}
</div>
@endforelse
</div>
<div class="mt-6">
{{ $notifications->links() }}
</div>
</div>
</div>
@endsection