import { Component, inject } from '@angular/core';
import { Router, RouterLink } from '@angular/router';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatIconModule } from '@angular/material/icon';
import { AuthStore } from '../../../core/auth/auth-store';

@Component({
  selector: 'app-more',
  imports: [RouterLink, MatButtonModule, MatCardModule, MatIconModule],
  templateUrl: './more.html',
  styleUrl: './more.scss',
})
export class More {
  private readonly authStore = inject(AuthStore);
  private readonly router = inject(Router);
  protected readonly user = this.authStore.currentUser;

  protected logout(): void {
    this.authStore.clearSession();
    void this.router.navigateByUrl('/auth/login');
  }
}
