<?php

namespace LaraBB\User\Actions\Admin;

use JetBrains\PhpStorm\ArrayShape;
use LaraBB\Group\Tasks\FindTask as FindGroupTask;

/**
 * Class CreateAction
 * @package LaraBB\User\Actions\Admin
 */
class CreateAction
{
    /**
     * CreateAction constructor.
     * @param FindGroupTask $findGroupTask
     */
    public function __construct(private readonly FindGroupTask $findGroupTask)
    {
    }

    /**
     * @return array
     */
    #[ArrayShape([
        'groups' => "\Illuminate\Database\Eloquent\Collection|mixed|null",
        'active' => "string",
        'subactive' => "string"
    ])]
    public function run(): array
    {
        return [
            'groups'    => $this->findGroupTask->run(),
            'active'    => 'users',
            'subactive' => 'user'
        ];
    }
}
