import { Component, computed, inject } from '@angular/core';
import { RouterOutlet, RouterLink, RouterLinkActive } from '@angular/router';
import { AuthService } from '../../../core/services/auth.service';
import { ToastService } from '../../../core/services/toast.service';
@Component({
selector: 'app-layout',
standalone: true,
imports: [RouterOutlet, RouterLink, RouterLinkActive],
template: `
`,
})
export class LayoutComponent {
private authService = inject(AuthService);
userName = computed(() => this.authService.user()?.displayName || 'User');
userEmail = computed(() => this.authService.user()?.email || '');
userInitial = computed(() => {
const name = this.authService.user()?.displayName || 'U';
return name.charAt(0).toUpperCase();
});
logout(): void {
this.authService.logout();
}
}