<?php

namespace App\Http\Livewire;

use Livewire\Component;

class MainContainer extends Component
{
    public $currentContent = '';
    public $loading = false;

    protected $listeners = ['menuChanged' => 'loadContent'];

    public function loadContent($menu)
    {
        $this->loading = true;

        // Simulate loading delay
        sleep(1);

        $this->currentContent = $menu;
        $this->loading = false;
    }

    public function render()
    {
        return view('livewire.main-container');
    }

}
