import {
booleanAttribute,
ChangeDetectionStrategy,
Component,
input,
} from '@angular/core';
import { AfricaniesIconComponent } from '@africanies/africanies-icons';
import {
ActionMenuComponent,
ActionMenuTriggerDirective,
} from '../action-menu';
import type { AfricaniesMenuItem } from '../action-menu/menu-item';
import { AvatarComponent, type AvatarSize } from './avatar.component';
/**
* Avatar trigger with an attached overflow menu — profile / account actions.
*
* @example
* ```html
*
* ```
*/
@Component({
selector: 'africanies-avatar-menu',
standalone: true,
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
AvatarComponent,
ActionMenuComponent,
ActionMenuTriggerDirective,
AfricaniesIconComponent,
],
template: `
@if (menuItems().length > 0) {
} @else {
}
`,
})
/**
* Avatar trigger with an attached overflow menu — profile / account actions.
*/
export class AvatarMenuComponent {
readonly name = input.required();
readonly src = input(null);
readonly menuItems = input.required();
readonly size = input('md');
readonly ariaLabel = input('Account menu');
readonly disabled = input(false, { transform: booleanAttribute });
/** When true (default), show a chevron beside the avatar. */
readonly showCaret = input(true, { transform: booleanAttribute });
}