import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { AuthService } from 'feature-auth';

/**
 * Authenticated demo page. First real consumer of `authGuard` — the
 * guard upstream guarantees `AuthService.currentUser()` is non-null
 * by the time the component renders, so the template can read it
 * directly without an "anonymous" branch.
 *
 * v1 carries just the user identity card. The route is a deliberate
 * stub to exercise the full auth loop end-to-end (guard → BFF /me →
 * SPA render); the real profile content lands when the user-profile
 * feature is in scope.
 */
@Component({
  selector: 'app-profile',
  templateUrl: './profile.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class Profile {
  private readonly auth = inject(AuthService);
  protected readonly user = this.auth.currentUser;
}
