import { DatePipe } from '@angular/common';
import {
booleanAttribute,
ChangeDetectionStrategy,
Component,
computed,
DestroyRef,
Directive,
inject,
input,
signal,
} from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import type { Observable } from 'rxjs';
import { AfricaniesIconComponent } from '@africanies/africanies-icons';
import type { AfricaniesMenuItem } from '../action-menu/menu-item';
import { AvatarComponent, AvatarMenuComponent } from '../avatar';
import { AfricaniesUiI18n } from '../i18n/africanies-ui-i18n';
import type { AfricaniesNotification, NotificationPageResult } from '../notifications';
import { NotificationDrawerService } from '../notifications';
import type { HeaderWeather } from './header-greeting.util';
import { pickHeaderGreeting } from './header-greeting.util';
import {
headerWeatherIcon,
headerWeatherLabel,
loadHeaderWeather,
} from './header-weather';
import { HEADER_WEATHER_CONFIG } from './header-weather.token';
/** Header density — affects clock visibility in narrow layouts. */
export type AppShellHeaderDensity = 'mobile' | 'tablet' | 'desktop';
/**
* Marks projected content as extra leading chrome in {@link AppShellHeaderComponent}.
*/
@Directive({
selector: '[africaniesAppShellHeaderStart]',
standalone: true,
})
/**
* Marks projected content as extra leading chrome in {@link AppShellHeaderComponent}.
*/
export class AppShellHeaderStartDirective {}
/**
* Marks projected content as extra trailing chrome in {@link AppShellHeaderComponent}.
*/
@Directive({
selector: '[africaniesAppShellHeaderEnd]',
standalone: true,
})
/**
* Marks projected content as extra trailing chrome in {@link AppShellHeaderComponent}.
*/
export class AppShellHeaderEndDirective {}
/**
* Product header bar for {@link AppShellComponent}: a short time-of-day kicker
* plus the given name, local weather, live clock, notification inbox drawer,
* and avatar menu.
* Breadcrumbs and Back belong in the content column via
* {@link AppShellContentHeaderComponent}.
*
* @example
* ```html
*
* ```
*/
@Component({
selector: 'africanies-app-shell-header',
standalone: true,
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
AfricaniesIconComponent,
AvatarComponent,
AvatarMenuComponent,
DatePipe,
],
template: `
@if (greeting(); as hello) {
{{ hello.kicker }}
{{ hello.name }}
}
@if (weather() || showClock()) {
@if (weather()) {
@if (weatherTemp(); as temp) {
{{ temp }}°C
}
{{ weatherCondition() }}@if (weatherCity(); as city) {
· {{ city }}
}