import { ChangeDetectionStrategy, Component } from '@angular/core';
import { RouterLink, RouterLinkActive } from '@angular/router';
import { Icon, type IconName } from 'shared-ui';

/**
 * Admin-side navigation. v1 lists the four modules from ADR-0020's
 * v1 admin catalogue (CMS, menu management, user list, audit log
 * viewer). Only the audit-log link points at a live route in this
 * PR; the rest land as routerLink placeholders disabled with
 * `aria-disabled`, so the navigation shape is established even
 * before the modules ship.
 *
 * No collapse mode (the portal-admin v1 layout doesn't need to
 * compete with content for screen real estate the way the user
 * portal does). When that changes we promote the
 * `LayoutStateService.sidebarCollapsed` signal here too.
 */

interface AdminMenuItem {
  readonly label: string;
  readonly icon: IconName;
  /** Live route once the module ships; placeholder when null. */
  readonly routerLink: string | null;
}

const MENU: readonly AdminMenuItem[] = [
  { label: 'Audit log', icon: 'file-text', routerLink: '/audit' },
  { label: 'CMS pages', icon: 'folder', routerLink: null },
  { label: 'Menu management', icon: 'layout-dashboard', routerLink: null },
  { label: 'User list', icon: 'building-2', routerLink: '/users' },
];

@Component({
  selector: 'app-admin-sidebar',
  imports: [RouterLink, RouterLinkActive, Icon],
  templateUrl: './sidebar.html',
  styleUrl: './sidebar.scss',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AdminSidebar {
  protected readonly menu = MENU;
}
