<?php

namespace App\Filament\Resources\DelayedGoods\Pages;

use App\Filament\Actions\Cheerful\CreateAction;
use App\Filament\Resources\DelayedGoods\DelayedGoodResource;
use Filament\Resources\Pages\ManageRecords;
use Filament\Support\Enums\Width;

class ListDelayedGoods extends ManageRecords
{
    protected static string $resource = DelayedGoodResource::class;

    protected static ?string $title = 'Barang Tertunda';

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