<?php

namespace App\Filament\Resources\Finance\Expenses\Pages;

use App\Filament\Actions\Cheerful\CreateAction;
use App\Filament\Resources\Finance\Expenses\ExpenseResource;
use Filament\Resources\Pages\ManageRecords;
use Filament\Support\Enums\Width;

class ManageExpenses extends ManageRecords
{
    protected static string $resource = ExpenseResource::class;

    protected static ?string $title = 'Pengeluaran';

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