<?php

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

use App\Filament\Actions\Cheerful\CreateAction;
use App\Filament\Resources\Master\SubClassifications\SubClassificationResource;
use App\Filament\Support\CheerfulNotification;
use Filament\Resources\Pages\ManageRecords;
use Filament\Support\Enums\Width;

class ManageSubClassifications extends ManageRecords
{
    protected static string $resource = SubClassificationResource::class;

    protected static ?string $title = 'Subklasifikasi';

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