<?php

namespace humhub\modules\suggestedfollowing;

use humhub\modules\dashboard\widgets\Sidebar;
use yii\base\Event;

/**
 * Event handlers for the Suggested Following module.
 *
 * @package humhub\modules\suggestedfollowing
 */
class Events
{
    public static function onDashboardSidebarInit(Event $event): void
    {
        /** @var Sidebar $sidebar */
        $sidebar = $event->sender;

        if (\Yii::$app->user->isGuest) {
            return;
        }

        $sidebar->addWidget(widgets\SuggestedFollowingDashboardWidget::class, [], ['sortOrder' => 310]);
    }
}
