<?php

namespace App\Filament\Resources\Feed\FeedSchedules\Pages;

use App\Filament\Actions\Cheerful\CreateAction;
use App\Filament\Resources\Feed\FeedSchedules\FeedScheduleResource;
use Filament\Resources\Pages\ManageRecords;
use Filament\Support\Enums\Width;

class ManageFeedSchedules extends ManageRecords
{
    protected static string $resource = FeedScheduleResource::class;

    protected static ?string $title = 'Jadwal Pakan';

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