2019-12-03 18:59:11 +09:00

40 lines
941 B
TypeScript

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