<?php

namespace LaraBB\User\Actions\Admin;

use JetBrains\PhpStorm\ArrayShape;
use LaraBB\User\Tasks\FindTask as FindUserTask;

/**
 * Class OverviewAction
 * @package LaraBB\User\Actions\Admin
 */
class IndexAction
{
    /**
     * OverviewAction constructor.
     * @param FindUserTask $findUserTask
     */
    public function __construct(private readonly FindUserTask $findUserTask)
    {

    }

    /**
     * @return array
     */
    #[ArrayShape([
        'users' => "mixed",
        'active' => "string"
    ])]
    public function run(): array
    {
        return [
            'users' => $this->findUserTask->all(['groups']),
            'active' => 'users'
        ];
    }
}
