<?php

namespace App\Http\Controllers\Player;

use App\FiveM\Contracts\FrameworkAdapter;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Inertia\Inertia;
use Inertia\Response;

class HouseController extends Controller
{
    public function index(Request $request, FrameworkAdapter $adapter, string $citizenId): Response
    {
        $character = CharacterController::ownedCharacterOrAbort($request, $adapter, $citizenId);

        return Inertia::render('Player/Characters/Houses', [
            'citizenId' => $citizenId,
            'characterName' => $character->name,
            'houses' => $adapter->housesForCitizen($citizenId),
        ]);
    }
}
