import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';

@Component({
  selector: 'app-social-media',
  imports: [],
  templateUrl: './social-media.component.html',
  styleUrl: './social-media.component.scss',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SocialMediaComponent {
  readonly code = input.required<string>();
  readonly icon = input.required<string>();
  readonly name = input.required<string>();
  readonly url = input.required<string>();

  protected readonly iconClass = computed(() => {
    const icon = this.icon().trim();

    return icon.includes('fa-') ? icon : `fa-brands fa-${icon}`;
  });
}
