<?php

namespace App\Filament\Resources\Cashboxes\Pages;

use App\Filament\Resources\Cashboxes\CashboxResource;
use Filament\Actions\CreateAction;
use Filament\Resources\Pages\ListRecords;

class ListCashboxes extends ListRecords
{
    protected static string $resource = CashboxResource::class;

    protected function getHeaderActions(): array
    {
        // إخفاء زر الإضافة للـ Super Admin (يظهر فقط للـ Tenant Owner)
        if (auth()->user()?->is_system_admin && !auth()->user()?->is_tenant_owner) {
            return [];
        }

        return [
            CreateAction::make()
                ->label('إضافة خزينة'),
        ];
    }
    public function getTitle(): string
    {
        return __('filament/admin/list_cashboxes.title');
    }

    public static function getNavigationLabel(): string
    {
        return __('filament/admin/list_cashboxes.title');
    }

}
