<?php

namespace App\Apps\Versionmgr\Controllers;

use App\Apps\Versionmgr\Services\VersionCheckService;
use App\Http\Controllers\Controller;

class DashboardController extends Controller
{
    protected VersionCheckService $versionCheckService;

    public function __construct(VersionCheckService $versionCheckService)
    {
        $this->versionCheckService = $versionCheckService;
    }

    public function index()
    {
        $currentResult = $this->versionCheckService->getCurrentVersion();
        $currentVersion = $currentResult['data'] ?? [];

        return view('versionmgr::dashboard.index', [
            'currentVersion' => $currentVersion,
        ]);
    }
}
