/**
 * Structure mapping configuration
 * Maps content types to their valid structures and provides label mappings
 */

export const CONTENT_TYPE_OPTIONS = [
  { value: 'post', label: 'Post' },
  { value: 'page', label: 'Page' },
  { value: 'product', label: 'Product' },
  { value: 'taxonomy', label: 'Taxonomy' },
];

export const CONTENT_STRUCTURE_BY_TYPE: Record<string, Array<{ value: string; label: string }>> = {
  post: [
    { value: 'article', label: 'Article' },
    { value: 'guide', label: 'Guide' },
    { value: 'comparison', label: 'Comparison' },
    { value: 'review', label: 'Review' },
    { value: 'listicle', label: 'Listicle' },
  ],
  page: [
    { value: 'landing_page', label: 'Landing Page' },
    { value: 'business_page', label: 'Business Page' },
    { value: 'service_page', label: 'Service Page' },
    { value: 'general', label: 'General' },
    { value: 'cluster_hub', label: 'Cluster Hub' },
  ],
  product: [
    { value: 'product_page', label: 'Product Page' },
  ],
  taxonomy: [
    { value: 'category_archive', label: 'Category Archive' },
    { value: 'tag_archive', label: 'Tag Archive' },
    { value: 'attribute_archive', label: 'Attribute Archive' },
  ],
};

export const ALL_CONTENT_STRUCTURES = Object.values(CONTENT_STRUCTURE_BY_TYPE).flat();

export const STRUCTURE_LABELS: Record<string, string> = {
  // Post
  article: 'Article',
  guide: 'Guide',
  comparison: 'Comparison',
  review: 'Review',
  listicle: 'Listicle',
  // Page
  landing_page: 'Landing Page',
  business_page: 'Business Page',
  service_page: 'Service Page',
  general: 'General',
  cluster_hub: 'Cluster Hub',
  // Product
  product_page: 'Product Page',
  // Taxonomy
  category_archive: 'Category Archive',
  tag_archive: 'Tag Archive',
  attribute_archive: 'Attribute Archive',
};

export const TYPE_LABELS: Record<string, string> = {
  post: 'Post',
  page: 'Page',
  product: 'Product',
  taxonomy: 'Taxonomy',
};

export const getStructureOptions = (contentType: string) => {
  return CONTENT_STRUCTURE_BY_TYPE[contentType] || [];
};
