@extends('layouts.app')
@section('title', __('Notifications'))

@section('content')
<h1 class="h4 fw-bold mb-3">🔔 {{ __('Notifications') }}</h1>

<div class="mb-card p-3" style="max-width:42rem">
    @forelse($notifications as $n)
        @php($d = $n->data)
        <div class="d-flex gap-3 py-2 border-bottom" style="border-color:var(--mb-line) !important">
            <div style="font-size:1.5rem">
                {{ ($d['status'] ?? '') === 'trialing' ? '🎁' : '⏰' }}
            </div>
            <div class="flex-grow-1">
                <div class="fw-semibold">
                    {{ ($d['status'] ?? '') === 'trialing'
                        ? __('Your trial ends in :days day(s)', ['days' => $d['days_left'] ?? 0])
                        : __('Your subscription renews in :days day(s)', ['days' => $d['days_left'] ?? 0]) }}
                </div>
                <div class="mb-muted small">{{ $n->created_at->diffForHumans() }}</div>
                @if(! empty($d['billing_url']))
                    <a href="{{ route('tenant.billing') }}" class="btn btn-sm mb-btn-ghost mt-1">{{ __('Manage billing') }}</a>
                @endif
            </div>
        </div>
    @empty
        <p class="mb-muted text-center py-4 mb-0">{{ __('No notifications.') }}</p>
    @endforelse
</div>
<div class="mt-3">{{ $notifications->links() }}</div>
@endsection
