<?php

namespace App\Components\Client;

use App\Models\Client\Client;
use App\Trait\ManagesEvidenceReview;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Livewire\Component;

/**
 * The client page's embedded "Evidence" tab. Renders the same recipient → DSAR
 * grouped review as the standalone workbench (via ManagesEvidenceReview), topped
 * with a headline totals strip.
 */
class ClientEvidence extends Component
{
    use AuthorizesRequests, ManagesEvidenceReview;

    public Client $client;

    public function mount(): void
    {
        $this->authorize('dsars.view');
    }

    public function render()
    {
        return view('components.client.client-evidence', array_merge(
            $this->evidenceReviewData(),
            ['exportUrl' => route('clients.evidence.export', $this->client)],
        ));
    }
}
