import { Component, OnInit, inject } from '@angular/core';
import { AlgorithmsService } from './algorithms.service';
import { AlgorithmCategory } from './algorithm-category';
import { Observable } from 'rxjs';
import { CommonModule } from '@angular/common';
import { RouterLink } from '@angular/router';
import { MatCardModule } from '@angular/material/card';
import {TranslatePipe} from '@ngx-translate/core';

@Component({
  selector: 'app-algorithms',
  templateUrl: './algorithms.component.html',
  styleUrls: ['./algorithms.component.scss'],
  standalone: true,
  imports: [CommonModule, RouterLink, MatCardModule, TranslatePipe],
})
export class AlgorithmsComponent implements OnInit {
  private readonly algorithmsService = inject(AlgorithmsService);

  categories$: Observable<AlgorithmCategory[]> | undefined;

  ngOnInit(): void {
    this.categories$ = this.algorithmsService.getCategories();
  }
}
