<?php

declare(strict_types=1);

namespace App\Livewire\Guest;

use App\Models\SupportTicket;
use Livewire\Attributes\Computed;
use Livewire\Attributes\Layout;
use Livewire\Component;

#[Layout('layouts.dashboard')]
final class Dashboard extends Component
{
    #[Computed]
    public function openTicketCount(): int
    {
        return SupportTicket::query()
            ->where('user_id', auth()->id())
            ->whereNotIn('status', ['resolved', 'closed'])
            ->count();
    }

    public function render()
    {
        return view('livewire.guest.dashboard');
    }
}
