<?php

declare(strict_types=1);

namespace App\Filament\Widgets\Tenant;

use App\Models\Tenant;
use App\Support\Tenants\TenantLifecyclePresentation;
use Filament\Facades\Filament;
use Filament\Widgets\Widget;

class TenantArchivedBanner extends Widget
{
    protected static bool $isLazy = false;

    protected string $view = 'filament.widgets.tenant.tenant-archived-banner';

    /**
     * @return array<string, mixed>
     */
    protected function getViewData(): array
    {
        $tenant = Filament::getTenant();

        return [
            'tenant' => $tenant instanceof Tenant ? $tenant : null,
            'presentation' => $tenant instanceof Tenant ? TenantLifecyclePresentation::fromTenant($tenant) : null,
        ];
    }
}
