<?php

namespace App\Modules\Card\Filament\Actions;

use App\Modules\Card\Models\Card;
use App\Modules\CardRequisite\Repositories\CardRequisiteRepository;
use Filament\Actions\Action;

class DownloadCardRequisteAction
{
    public static function make(): Action
    {
        return Action::make('card_requisite')
            ->label(__('Card requisite'))
            ->icon('heroicon-o-document-text')
            ->requiresConfirmation()
            ->modalIcon('heroicon-o-document-text')
            ->action(fn (Card $record) => CardRequisiteRepository::make()->downloadCardRequisite($record));
    }
}
