<?php

namespace App\Filament\Admin\Resources\InvoiceResource\Pages;

use App\Filament\Admin\Resources\InvoiceResource;
use App\Models\Invoice;
use Filament\Actions;
use Filament\Actions\Action;
use Filament\Resources\Pages\EditRecord;
use Illuminate\Contracts\Support\Htmlable;

class EditInvoice extends EditRecord
{
    protected static string $resource = InvoiceResource::class;

    public function getTitle(): string|Htmlable
    {
        return parent::getTitle().' '.$this->record->internal_id;
    }

    protected function getHeaderActions(): array
    {
        return [
            Action::make('print')
                ->icon('lucide-printer')
                ->url(fn (Invoice $record) => route('invoice.pdf', $record))
                ->openUrlInNewTab(),
            Actions\DeleteAction::make()
                ->icon('lucide-trash-2'),
        ];
    }
}
