40 lines
942 B
TypeScript
40 lines
942 B
TypeScript
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
|
import { ucapAnimations } from '../../animations';
|
|
import { FileInfo } from '@ucap-webmessenger/protocol-file';
|
|
import { FileDownloadItem } from '@ucap-webmessenger/api';
|
|
|
|
@Component({
|
|
selector: 'ucap-document-viewer',
|
|
templateUrl: './document-viewer.component.html',
|
|
styleUrls: ['./document-viewer.component.scss'],
|
|
animations: ucapAnimations
|
|
})
|
|
export class DocumentViewerComponent implements OnInit {
|
|
@Input()
|
|
fileInfo: FileInfo;
|
|
|
|
@Input()
|
|
fileDownloadUrl: string;
|
|
|
|
@Output()
|
|
download = new EventEmitter<FileDownloadItem>();
|
|
|
|
@Output()
|
|
closed = new EventEmitter<void>();
|
|
|
|
fileDownloadItem: FileDownloadItem;
|
|
|
|
constructor() {}
|
|
|
|
ngOnInit() {}
|
|
|
|
onClickDownload(): void {
|
|
this.fileDownloadItem = new FileDownloadItem();
|
|
this.download.emit(this.fileDownloadItem);
|
|
}
|
|
|
|
onClickClose(): void {
|
|
this.closed.emit();
|
|
}
|
|
}
|