<?php

namespace App\Livewire;

use Livewire\Component;
use Livewire\Attributes\Layout;  // Required for layout declaration

#[Layout('layouts.dashboard')]  // Attribute syntax for Laravel 11
class TopUpUsageReport extends Component
{
    public $topUpUsage = [];

    public function mount()
    {
        $this->loadTopUpUsage();  // Load topUpUsage initially
    }

    public function loadTopUpUsage()
    {
        $this->topUpUsage = collect(json_decode(file_get_contents(storage_path('app/topup-usage-report.json')), true));
    }

    public function render()
    {
        return view('livewire.report.top-up-usage-report', [
            'topUpUsage' => $this->topUpUsage, 
        ]);
    }
}





