import { Component, computed, inject } from '@angular/core'; import { CommonModule } from '@angular/common'; import { RouterLink, RouterOutlet } from '@angular/router'; import { BootstrapService } from '../../core/services/bootstrap.service'; import { AuthService } from '../../core/services/auth.service'; import { shouldShowAdminNav } from './home.shell'; export { shouldShowAdminNav } from './home.shell'; @Component({ selector: 'app-home', standalone: true, imports: [CommonModule, RouterLink, RouterOutlet], template: `

{{ bootstrap.payload()?.pageTitle ?? 'HIPCTF' }}

Signed in as {{ auth.currentUser()?.username }} ({{ auth.currentUser()?.role }})

{{ bootstrap.payload()?.welcomeMarkdown }}

Sign in
`, }) export class HomeComponent { bootstrap = inject(BootstrapService); auth = inject(AuthService); readonly showAdminNav = computed(() => shouldShowAdminNav({ isAuthenticated: this.auth.isAuthenticated(), role: this.auth.currentUser()?.role, }), ); }