import { CommonModule } from '@angular/common';
import { Component, OnInit } from '@angular/core';
import { RouterModule } from '@angular/router';
import { SeoService } from '../../services/seo.service';
import { BreadcrumbItem, BreadcrumbsComponent } from '../breadcrumbs/breadcrumbs.component';

@Component({
  selector: 'app-not-found',
  standalone: true,
  imports: [CommonModule, RouterModule, BreadcrumbsComponent],
  templateUrl: './not-found.component.html',
})
export class NotFoundComponent implements OnInit {
  breadcrumbs: BreadcrumbItem[] = [
    { label: 'Home', url: '/home', icon: 'fas fa-home' },
    { label: '404 - Page Not Found' }
  ];

  constructor(private seoService: SeoService) {}

  ngOnInit(): void {
    // Set noindex to prevent 404 pages from being indexed
    this.seoService.setNoIndex();

    // Set appropriate meta tags for 404 page
    this.seoService.updateMetaTags({
      title: '404 - Page Not Found | BizMatch',
      description: 'The page you are looking for could not be found. Return to BizMatch to browse businesses for sale or commercial properties.',
      type: 'website'
    });
  }
}
