import { Component, computed, Input } from '@angular/core';
import { PdfViewerModule } from 'ng2-pdf-viewer';
import { environment } from '@env/environment';
import { ProfileViewModel } from '@app/ui/profiles/profile.presenter.model';

@Component({
  selector: 'app-pdf-viewer',
  standalone: true,
  imports: [PdfViewerModule],
  templateUrl: './pdf-viewer.component.html',
  styleUrl: './pdf-viewer.component.scss',
})
export class PdfViewerComponent {
  @Input({ required: true }) profile: ProfileViewModel | undefined = undefined;
  protected readonly environment = environment;
  protected readonly cv_link = computed(() => {
    return `${environment.baseUrl}/api/files/profiles/${this.profile!.id}/${this.profile!.cv}`;
  });
}
