import { CSSProperties } from 'react';

export interface WhpConfig {
  user: string;
  apiUrl: string;
  csrfToken: string;
  siteId: number;
  siteDomain: string;
  siteName: string;
  backUrl: string;
  isRoot: boolean;
}

/**
 * Per-page SEO/meta overrides (PKG-H contract §1). All fields optional --
 * an absent `seo` (or absent individual field) means "no override, fall
 * back to the page name / no tag emitted", preserving back-compat for
 * every project saved before this field existed.
 */
export interface PageSeo {
  /** Overrides <title>; when empty, <title> falls back to page.name. */
  metaTitle?: string;
  /** <meta name="description"> + og:description. */
  metaDescription?: string;
  /** og:title; when empty falls back to metaTitle || page.name. */
  ogTitle?: string;
  /** Absolute or site-relative image URL (via AssetPicker mediaType=image). */
  ogImage?: string;
  /** Default 'summary_large_image' when ogImage set, else 'summary'. */
  twitterCard?: 'summary' | 'summary_large_image';
  /** Emits <meta name="robots" content="noindex, nofollow">. */
  noindex?: boolean;
}

export interface PageData {
  id: string;
  name: string;
  slug: string;
  craftState: string | null;
  /** NEW -- optional; absent === no SEO overrides (back-compat). */
  seo?: PageSeo;
}

export interface AssetData {
  name: string;
  url: string;
  type: string;
  size?: number;
  modified?: number;
}

export interface StyleProps {
  style?: CSSProperties;
}

export type DeviceMode = 'desktop' | 'tablet' | 'mobile';
