<?php

namespace App\Filament\Construction\Resources\VendorResource\Pages;

use App\Filament\Construction\Resources\VendorPaymentResource;
use App\Filament\Construction\Resources\VendorResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;

class EditVendor extends EditRecord
{
    protected static string $resource = VendorResource::class;

    protected function getHeaderActions(): array
    {
        return [
            Actions\Action::make('recordPayment')
                ->label('Record Payment')
                ->icon('heroicon-o-banknotes')
                ->color('success')
                ->visible(fn (): bool => VendorPaymentResource::userCanManagePayments())
                ->url(fn (): string => VendorPaymentResource::paymentCreateUrl($this->record->id)),
            Actions\DeleteAction::make(),
        ];
    }
}
