<?php

namespace App\Http\Controllers\Employee;

use App\Http\Controllers\Controller;
use App\Models\AssetAssignment;
use Illuminate\Http\Request;
use Inertia\Inertia;
use Inertia\Response;

class AssetController extends Controller
{
    public function index(Request $request): Response
    {
        $assignments = AssetAssignment::with(['asset.category'])
            ->where('user_id', auth()->id())
            ->orderBy('assigned_at', 'desc')
            ->get();

        return Inertia::render('Employee/Assets/Index', [
            'assignments' => $assignments,
        ]);
    }
}
