import { Component, effect, inject } from '@angular/core';
import { PostEditorComponent } from '../../components/post-editor/post-editor.component';
import { NgFor } from '@angular/common';
import { PostsService } from '../../shared/services/posts.service';
import { RouterLink, RouterOutlet } from '@angular/router';

@Component({
  selector: 'app-admin',
  imports: [NgFor, RouterLink],
  standalone: true,
  templateUrl: './dashboard.component.html',
})
export class DashboardComponent {
  private postsService = inject(PostsService);
  posts = this.postsService.getPosts();

  delete(id: number) {
    this.postsService.deletePost(id);
  }
}
