mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.1 KiB
51 lines
1.1 KiB
/*
|
|
* Squidex Headless CMS
|
|
*
|
|
* @license
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
|
|
*/
|
|
|
|
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
import { ScheduleDto } from '@app/shared';
|
|
|
|
@Component({
|
|
selector: 'sqx-content-status',
|
|
styleUrls: ['./content-status.component.scss'],
|
|
templateUrl: './content-status.component.html',
|
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
})
|
|
export class ContentStatusComponent {
|
|
@Input()
|
|
public status: string;
|
|
|
|
@Input()
|
|
public statusColor: string;
|
|
|
|
@Input()
|
|
public scheduled?: ScheduleDto;
|
|
|
|
@Input()
|
|
public layout: 'icon' | 'text' | 'multiline' = 'icon';
|
|
|
|
@Input()
|
|
public truncate = false;
|
|
|
|
@Input()
|
|
public small = false;
|
|
|
|
public get isMultiline() {
|
|
return this.layout === 'multiline';
|
|
}
|
|
|
|
public get isText() {
|
|
return this.layout === 'text';
|
|
}
|
|
|
|
public get tooltipText() {
|
|
if (this.scheduled) {
|
|
return `Will be set to '${this.scheduled.status}' at ${this.scheduled.dueTime.toStringFormat('PPpp')}`;
|
|
} else {
|
|
return this.status;
|
|
}
|
|
}
|
|
}
|