<?php

namespace Shm\ShmAddons\AdminActions;

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

class AdminAction
{

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


    public $multiSelect = false;

    public $key = null;


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

    public function icon(): string
    {
        return  MaterialIcons::AccessPoint();
    }

    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 resolve(array $ids, $args): AdminActionResult | null
    {
        return null;
    }
}
