<?php

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

use App\Filament\Actions\Cheerful\CreateAction;
use App\Filament\Resources\Feed\Feeds\FeedResource;
use Filament\Resources\Pages\ManageRecords;
use Filament\Support\Enums\Width;

class ManageFeeds extends ManageRecords
{
    protected static string $resource = FeedResource::class;

    protected static ?string $title = 'Pakan';

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