<?php

namespace App\Filament\Resources\Master\Departments\Pages;

use App\Filament\Actions\Cheerful\CreateAction;
use App\Filament\Resources\Master\Departments\DepartmentResource;
use Filament\Resources\Pages\ManageRecords;
use Filament\Support\Enums\Width;

class ManageDepartments extends ManageRecords
{
    protected static string $resource = DepartmentResource::class;

    protected static ?string $title = 'OPD';

    protected function getHeaderActions(): array
    {
        return [
            CreateAction::make()
                ->label('Tambah')
                ->modalHeading('Tambah OPD')
                ->modalSubmitActionLabel('Simpan')
                ->modalCancelActionLabel('Batal')
                ->extraModalFooterActions(fn (CreateAction $action): array => [
                    $action->makeModalSubmitAction('createAnother', arguments: ['another' => true])
                        ->label('Simpan dan Tambah Lagi'),
                ])
                ->modalWidth(Width::Large),
        ];
    }
}
