paperless-ngx/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.ts

39 lines
1 KiB
TypeScript
Raw Normal View History

import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2020-10-27 01:10:18 +01:00
import { PaperlessDocument } from 'src/app/data/paperless-document';
import { PaperlessTag } from 'src/app/data/paperless-tag';
2020-10-27 01:10:18 +01:00
import { DocumentService } from 'src/app/services/rest/document.service';
@Component({
selector: 'app-document-card-small',
templateUrl: './document-card-small.component.html',
styleUrls: ['./document-card-small.component.scss']
2020-10-27 01:10:18 +01:00
})
export class DocumentCardSmallComponent implements OnInit {
constructor(private documentService: DocumentService) { }
@Input()
document: PaperlessDocument
@Output()
clickTag = new EventEmitter<PaperlessTag>()
@Output()
clickCorrespondent = new EventEmitter<PaperlessDocument>()
2020-10-27 01:10:18 +01:00
ngOnInit(): void {
}
getThumbUrl() {
return this.documentService.getThumbUrl(this.document.id)
}
getDownloadUrl() {
return this.documentService.getDownloadUrl(this.document.id)
}
getPreviewUrl() {
return this.documentService.getPreviewUrl(this.document.id)
}
2020-10-27 01:10:18 +01:00
}