import { Component, inject, Input, OnInit } from '@angular/core';
import { AuthService } from '@app/core/services/authentication/auth.service';
import { environment } from '@env/environment';
import { RouterLink } from '@angular/router';
import { ProjectFacade } from '@app/ui/projects/project.facade';

@Component({
  selector: 'app-my-profile-project-item',
  standalone: true,
  imports: [RouterLink],
  templateUrl: './my-profile-project-item.component.html',
  styleUrl: './my-profile-project-item.component.scss',
})
export class MyProfileProjectItemComponent implements OnInit {
  protected readonly environment = environment;
  @Input({ required: true }) projectId = '';
  protected authService = inject(AuthService);

  private readonly projectFacade = new ProjectFacade();
  protected project = this.projectFacade.project;

  ngOnInit(): void {
    this.projectFacade.loadOne(this.projectId);
  }
}
