import { Component, Input, output } from '@angular/core';
import { RouterLink } from '@angular/router';
import { SocialMedia } from '../../../services/tenant.interface';
import { SocialMediaComponent } from '../../../../shared/components/social-media/social-media.component';

export type StoreFooterLink = {
  label: string;
  routerLink?: string;
  action?: 'logout';
};

export type StoreFooterSection = {
  heading: string;
  links: StoreFooterLink[];
};

@Component({
  selector: 'app-store-footer',
  imports: [RouterLink, SocialMediaComponent],
  templateUrl: './store-footer.component.html',
  styleUrl: './store-footer.component.scss',
})
export class StoreFooterComponent {
  @Input({ required: true }) currentYear = new Date().getFullYear();
  @Input({ required: true }) footerSections: StoreFooterSection[] = [];
  @Input({ required: true }) socialMedia: SocialMedia[] = [];
  @Input() logoUrl: string | null = null;
  @Input() backgroundImageUrl: string | null = null;
  @Input() storeName: string | null = null;
  @Input() address: string | null = null;
  @Input() phone: string | null = null;
  readonly logoutClick = output<void>();
}
