import { Component, inject, Input } from '@angular/core';
import { PostsService } from '../../shared/services/posts.service';
import { JsonPipe, NgIf } from '@angular/common';
import { MarkdownComponent } from '../../components/markdown/markdown.component';

@Component({
  selector: 'app-post',
  imports: [MarkdownComponent],
  standalone: true,
  templateUrl: './post.component.html',
})
export class PostComponent {
  @Input() id!: string;
  private postsService = inject(PostsService);

  get post() {
    return this.postsService.getPost(parseInt(this.id));
  }
}
