]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/blob
aa15a77217df68f755fa064417bc023281007f62
[ceph.git] /
1 import { Component, Input } from '@angular/core';
2 import { Icons } from '../../enum/icons.enum';
3
4 @Component({
5   selector: 'cd-inline-message',
6   templateUrl: './inline-message.component.html',
7   styleUrl: './inline-message.component.scss'
8 })
9 export class InlineMessageComponent {
10   // collapsible when true will show read more/read less button
11   @Input()
12   collapsible = false;
13   // title to show in the message
14
15   @Input()
16   title = '';
17
18   // callback function to execute onclose
19   @Input()
20   onClose?: () => void = () => {};
21
22   isTruncated = false;
23   icons = Icons;
24   isDismissed = false;
25
26   close() {
27     this.isDismissed = true;
28     if (this.onClose) {
29       this.onClose();
30     }
31   }
32
33   toggleContent() {
34     this.isTruncated = !this.isTruncated;
35   }
36 }