How to pass record to table row action?

Hi guys, I am trying dynamically create actions for my table rows:
public function table(Table $table): Table
{
    return parent::table($table)
        ->columns([...])
        ->actions([
            Tables\Actions\ActionGroup::make([
                [...$this->getContractStatusActions(fn (Contract $record) => $record)],
            ]),
        ]);
}

private function getContractStatusActions(\Closure $closure): array
{
    /** @var Contract $contract */
    $contract = $closure();

    $nextState = $contract->status->getNextState();

    return collect($nextState)
        ->map(function (ContractStatus $state) use ($contract) {
            return Tables\Actions\Action::make('updateStatus')
                ->label($state->getLabel())
                ->action(fn () => $contract->update(['status' => $state]));
        })
        ->toArray();
}

I am still getting this error:
Too few arguments to function App\Filament\Resources\ContractResource\Pages\ListContracts::App\Filament\Resources\ContractResource\Pages\{closure}(), 0 passed in /Users/me/Developer/Sites/leasing/app/Filament/Resources/ContractResource/Pages/ListContracts.php on line 91 and exactly 1 expected
Was this page helpful?