// Глобальные интерфейсы для компонентов

export interface Course {
  id: string;
  title: string;
  slug: string;
  description: string;
  price: number;
  duration: string;
  level: string;
  tags?: string[];
  content?: string;
  thumbnail?: string;
}

export interface AboutData {
  id: string;
  collectionId: string;
  title: string;
  description: string;
  professional_experience: string;
  skills: string[];
  contact_title: string;
  contact_description: string;
  whatsapp_link: string;
  email: string;
  image: string;
  alt_text: string;
  isActive: boolean;
}

export interface Project {
  id: string;
  collectionId: string;
  title: string;
  description: string;
  short_description: string;
  long_description: string;
  stack: string[];
  github_link: string;
  demo_link: string;
  image: string;
  alt_text: string;
  order: number;
  isActive: boolean;
}

export interface FeaturedProject {
  id: string;
  collectionId: string;
  name: string;
  description: string;
  image: string;
  url: string;
  github?: string;
  stack: string[];
  featured: boolean;
  forSale: boolean;
  order: number;
  isActive: boolean;
}

export interface Post {
  id: string;
  title: string;
  description: string;
  publishDate: string;
  slug: string;
  tags: string[];
  content?: string;
  image?: string; // Legacy field name
  coverImage?: string; // Actual field name from PocketBase
  coverImageAlt?: string; // Alt text for the cover image
  isFeatured?: boolean;
  isActive: boolean;
}

export interface PaginationProps {
  currentPage: number;
  lastPage: number;
  url: {
    prev?: string;
    next?: string;
  };
}

// Вспомогательная функция для декодирования HTML-сущностей
export function decodeHtmlEntities(text: string): string {
  return text.replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&amp;/g, '&');
}