24 lines
628 B
TypeScript
24 lines
628 B
TypeScript
import { CommonModule } from '@angular/common';
|
|
import { Component, inject } from '@angular/core';
|
|
import { ToastItem, ToastService } from '../../core/services/toast.service';
|
|
|
|
@Component({
|
|
selector: 'app-toast-outlet',
|
|
standalone: true,
|
|
imports: [CommonModule],
|
|
templateUrl: './toast-outlet.component.html'
|
|
})
|
|
export class ToastOutletComponent {
|
|
readonly toast = inject(ToastService);
|
|
|
|
toneDotClass(item: ToastItem) {
|
|
return item.tone === 'success'
|
|
? 'bg-success'
|
|
: item.tone === 'danger'
|
|
? 'bg-danger'
|
|
: item.tone === 'warning'
|
|
? 'bg-warning'
|
|
: 'bg-info';
|
|
}
|
|
}
|