<?php

namespace Shm\ShmAddons\AdminActions;

use Shm\Shm;
use Shm\ShmTypes\StructureType;
use Shm\ShmUtils\LuIcons;
use Shmop;

class AdminAction
{

    public static function create(): AdminAction
    {
        return new static();
    }




    public $key = null;


    public function title(): string
    {
        return $this->key;
    }

    public function icon(): string
    {
        //square-arrow-right
        return  LuIcons::SquareArrowRight();
    }

    public function getShortClassName(): string
    {
        $fullClassName = static::class;
        $parts = explode('\\', $fullClassName);
        $shortName = end($parts);

        return lcfirst($shortName);
    }

    public function __construct()
    {



        if (!$this->key) {
            $this->key = $this->getShortClassName();
        }
    }

    public function argsSchema(array $ids): StructureType
    {
        return Shm::structure([]);
    }

    public function shouldShow(array $ids): bool
    {
        return true;
    }

    public function resolve(array $ids, $args): AdminActionResult | null
    {
        return null;
    }
}