<?php

use App\Models\Maladie;
use App\Models\ReportQuarter;
use App\Services\RepportService;
use Livewire\Component;

return new class extends Component
{
    public $data = [];
    public $input = [];
    public $classes = [];
    public $school;
    public $cutting;

    public function mount() {
        $report = ReportQuarter::where('school_id', $this->school)->where('cutting_school_year_id', $this->cutting)->first();
        $dts = $report ? Maladie::where('report_quarter_id', $report->id)->orderBy('order')->get():[];
        $this->data = $dts;
    }

    public function myInput(RepportService $service) {
        $this->input = $this->data;
        $this->classes = $service->getClass($this->school, $this->cutting);
    }

    protected function view($data = [])
    {
        return app('view')->file('C:\Users\EDUCAS\Desktop\App\V4_001\storage\framework/views/livewire/views/74aba827.blade.php', $data);
    }
};
