<?php

namespace App\Admin\Actions;

use Dcat\Admin\Form\AbstractTool;
use Dcat\Admin\Widgets\Modal;

class SendOrder extends AbstractTool
{
    /**
     * @return string
     */
    protected $title = '发货';

    protected $model;

    public function __construct(string $model = null, $id = 0)
    {
        $this->model = $model;
        $this->title = '<i class="feather icon-check-square"></i> ' . $this->title;
        $this->id = $id;
    }

    public function render()
    {
        $form = SendOrderForm::make()->payload(['id' => $this->id]);
        return Modal::make()
            ->lg()
            ->title($this->title)
            ->body($form)
            ->button($this->title);
    }

}
