import { Component, signal } from '@angular/core';
import {
AlertComponent,
type AlertVariant,
ButtonComponent,
} from '@africanies/africanies-ui';
import { DemoSectionComponent } from '../shared/demo-section.component';
import { PageHeaderComponent } from '../shared/page-header.component';
import { ALERT_DISMISSIBLE, ALERT_VARIANTS } from '../snippets';
/**
*
*/
@Component({
selector: 'app-alert-page',
standalone: true,
imports: [
AlertComponent,
ButtonComponent,
PageHeaderComponent,
DemoSectionComponent,
],
template: `
@for (v of variants; track v) {
}
@if (showBanner()) {
} @else {
}
`,
})
export class AlertPage {
protected readonly showBanner = signal(true);
protected readonly variants: AlertVariant[] = [
'info',
'success',
'warning',
'danger',
];
protected readonly titles: Record = {
info: 'Document checklist',
success: 'Submitted',
warning: 'Rates may be stale',
danger: 'Cannot release',
};
protected readonly messages: Record = {
info: 'Commercial invoice and packing list are still required.',
success: 'Shipment SFN-1042 was submitted to the carrier.',
warning: 'Last rate pull was more than 4 hours ago.',
danger: 'Customs hold blocks release until documents are approved.',
};
protected readonly variantsCode = ALERT_VARIANTS;
protected readonly dismissibleCode = ALERT_DISMISSIBLE;
protected onRefresh(): void {
this.showBanner.set(false);
}
}