<?php

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

use App\Filament\Resources\Manage\Cooperations\CooperationResource;
use Filament\Actions\CreateAction;
use Filament\Resources\Pages\ListRecords;
use Illuminate\Support\Facades\Auth;

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('Perusahaan')) {
            $actions[] = CreateAction::make()
                ->label('Tambah');
        }

        return $actions;
    }
}
