<?php

namespace App\Components\Client\Witness;

use App\Components\Client\Concerns\InteractsWithWitnessStatement;
use App\Models\Client\Client;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Livewire\Component;

/**
 * Concept 1 — Three-column workspace (Evidence | Questionnaire | Action rail).
 * Closest to the reference screenshot: everything on one screen, evidence and
 * actions permanently in view beside the questionnaire.
 */
class WitnessWorkspace extends Component
{
    use AuthorizesRequests, InteractsWithWitnessStatement;

    public function mount(Client $client): void
    {
        $this->authorize('clients.witness.view');
        $this->designMode = request()->routeIs('clients.witness.concept.*');
        $this->demoState = $this->designMode ? request()->query('state') : null;
        $this->bootWitnessWorkspace($client);
    }

    public function render()
    {
        return view('components.client.witness.witness-workspace', $this->witnessData())
            ->layout('layouts.dashboard');
    }
}
