<?php

// UserManagement.php
namespace App\Livewire;

use Livewire\Component;

class UserManagement extends Component
{
    public $users = [];

    public function mount()
    {
        $this->loadUsers();  // Load users initially
    }

    public function loadUsers()
    {
        $this->users = collect(json_decode(file_get_contents(storage_path('app/users.json')), true));
    }

    public function render()
    {
        return view('livewire.user-management.user-management', [
            'users' => $this->users,  // Pass all users to the table
        ]);
    }
}
