<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\View\View;

class AcademyController extends Controller
{
    public function fireShutter(Request $request): View|Response
    {
        if ($request->header('HX-Request')) {
            return response('', 200)->header('HX-Redirect', route('academy.fire-shutter'));
        }

        return view('academy.fire-shutter');
    }

    public function itPlanning(Request $request): View|Response
    {
        if ($request->header('HX-Request')) {
            return response('', 200)->header('HX-Redirect', route('academy.it-planning'));
        }

        return view('academy.it-planning');
    }

    public function serverKnowledge(Request $request): View|Response
    {
        if ($request->header('HX-Request')) {
            return response('', 200)->header('HX-Redirect', route('academy.server-knowledge'));
        }

        return view('academy.server-knowledge');
    }

    public function frontendDev(Request $request): View|Response
    {
        if ($request->header('HX-Request')) {
            return response('', 200)->header('HX-Redirect', route('academy.frontend-dev'));
        }

        return view('academy.frontend-dev');
    }

    public function dockerEnvironment(Request $request): View|Response
    {
        if ($request->header('HX-Request')) {
            return response('', 200)->header('HX-Redirect', route('academy.docker-environment'));
        }

        return view('academy.docker-environment');
    }

    public function dockerCommands(Request $request): View|Response
    {
        if ($request->header('HX-Request')) {
            return response('', 200)->header('HX-Redirect', route('academy.docker-commands'));
        }

        return view('academy.docker-commands');
    }

    public function webBasics(Request $request): View|Response
    {
        if ($request->header('HX-Request')) {
            return response('', 200)->header('HX-Redirect', route('academy.web-basics'));
        }

        return view('academy.web-basics');
    }

    public function backendDev(Request $request): View|Response
    {
        if ($request->header('HX-Request')) {
            return response('', 200)->header('HX-Redirect', route('academy.backend-dev'));
        }

        return view('academy.backend-dev');
    }

    public function envManagement(Request $request): View|Response
    {
        if ($request->header('HX-Request')) {
            return response('', 200)->header('HX-Redirect', route('academy.env-management'));
        }

        return view('academy.env-management');
    }

    public function gitPolicy(Request $request): View|Response
    {
        if ($request->header('HX-Request')) {
            return response('', 200)->header('HX-Redirect', route('academy.git-policy'));
        }

        return view('academy.git-policy');
    }

    public function gitTools(Request $request): View|Response
    {
        if ($request->header('HX-Request')) {
            return response('', 200)->header('HX-Redirect', route('academy.git-tools'));
        }

        return view('academy.git-tools');
    }

    public function nginxEncyclopedia(Request $request): View|Response
    {
        if ($request->header('HX-Request')) {
            return response('', 200)->header('HX-Redirect', route('academy.nginx-encyclopedia'));
        }

        return view('academy.nginx-encyclopedia');
    }

    public function linuxCommands(Request $request): View|Response
    {
        if ($request->header('HX-Request')) {
            return response('', 200)->header('HX-Redirect', route('academy.linux-commands'));
        }

        return view('academy.linux-commands');
    }

    public function pm2Guide(Request $request): View|Response
    {
        if ($request->header('HX-Request')) {
            return response('', 200)->header('HX-Redirect', route('academy.pm2-guide'));
        }

        return view('academy.pm2-guide');
    }

    public function taxCorrection(Request $request): View|Response
    {
        if ($request->header('HX-Request')) {
            return response('', 200)->header('HX-Redirect', route('academy.tax-correction'));
        }

        return view('academy.tax-correction');
    }
}
