@extends('layouts.app')

@section('page_title', 'Notification')

@section('content')
    <div id="notification-table">
        @if (session('success'))
            <div class="alert alert-success alert-dismissible fade show" role="alert">
                {{ session('success') }}
                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            </div>
        @endif
        @if (session('error') || $errors->has('error'))
            <div class="alert alert-danger alert-dismissible fade show" role="alert">
                {{ session('error') ?? $errors->first('error') }}
                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            </div>
        @endif
        <x-notification-component
            :data="$notifications"
            :showAddButton="true"
            :addButtonUrl="route('notification.create')"
        />
    </div>
@endsection