Files
Nexora/app/Livewire/PdfViewer.php
Javi 28c225687a
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
mejoras
2025-05-23 00:26:53 +02:00

38 lines
757 B
PHP

<?php
namespace App\Livewire;
use Illuminate\Support\Facades\Storage;
use Livewire\Component;
class PdfViewer extends Component
{
public $pdfUrl;
public $currentPage = 1;
public $totalPages = 1;
public $zoomLevel = 1;
protected $listeners = ['pageChanged', 'annotationSaved'];
public function mount($pdfId)
{
$this->pdfUrl = Storage::disk('pdfs')->temporaryUrl($pdfId, now()->addMinutes(30));
}
public function pageChanged($page)
{
$this->currentPage = $page;
}
public function annotationSaved($data)
{
// Procesar y guardar anotaciones
$this->emit('refreshAnnotations');
}
public function render()
{
return view('livewire.pdf-viewer');
}
}