import { ChangeDetectionStrategy, Component, inject, input, } from '@angular/core'; import { AfricaniesIconComponent } from '@africanies/africanies-icons'; import { ModeColorService } from '@africanies/africanies-theme'; /** * Layout density for {@link LoadingStateComponent}. * * - `block` — centered section placeholder (page / panel load) * - `inline` — compact row for toolbars and nested slots */ export type LoadingStateMode = 'inline' | 'block'; /** * Blocking / inline loading indicator for async surfaces. * * Spinner accent follows {@link ModeColorService} (SFN green / STN orange). * * @example * ```html * * * ``` */ @Component({ selector: 'africanies-loading-state', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [AfricaniesIconComponent], template: `
@if (message()) {

{{ message() }}

}
`, }) /** * Blocking / inline loading indicator for async surfaces. */ export class LoadingStateComponent { protected readonly modeColor = inject(ModeColorService); /** * Optional status copy. Prefer a short verb phrase ("Loading…") so screen * readers hear useful context with `aria-live="polite"`. */ readonly message = input(undefined); /** * Layout mode. Defaults to `block` for section-level placeholders. */ readonly mode = input('block'); }