import { Component, Input, Output, EventEmitter } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent, IonButton, IonIcon } from '@ionic/angular/standalone';
import { addIcons } from 'ionicons';
import { thumbsUpSharp, shareSocialSharp, chatbubbleEllipsesSharp, chevronUpCircleSharp } from 'ionicons/icons';

@Component({
  selector: 'app-feed-card',
  templateUrl: './feed-card.component.html',
  styleUrls: ['./feed-card.component.scss'],
  standalone: true,
  imports: [IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent, IonButton, IonIcon, CommonModule]
})
export class FeedCardComponent {
  @Input() card: any;
  @Output() scrollToTop = new EventEmitter<void>();

  constructor() {
    addIcons({
      'thumbs-up-sharp': thumbsUpSharp,
      'share-social-sharp': shareSocialSharp,
      'chatbubble-ellipses-sharp': chatbubbleEllipsesSharp,
      'chevron-up-circle-sharp': chevronUpCircleSharp
    });
  }

  triggerScrollToTop() {
    this.scrollToTop.emit();
  }
}
