<?php

namespace App\Filament\Resources\Manage\Cooperations\Pages;

use App\Enums\RoleEnum;
use App\Filament\Resources\Manage\Cooperations\CooperationResource;
use Filament\Actions\CreateAction;
use Filament\Resources\Pages\ListRecords;

class ListCooperations extends ListRecords
{
    protected static string $resource = CooperationResource::class;

    protected static ?string $title = 'Kerja Sama';

    protected function getHeaderActions(): array
    {
        $actions = [];

        if (! auth()->user()->hasRole(RoleEnum::PERUSAHAAN->value)) {
            $actions[] = CreateAction::make()
                ->label('Tambah');
        }

        return $actions;
    }
}
