import { ReactNode } from "react";

export type ClientsProps = {
  client_id: string | undefined;
  client: string;
  role: "admin" | "user";
  created_on: string;
  site: string;
  gsc_domain_type_property: boolean;
  subscription: {
    items_per_month: number;
    subscription_type: number;
  };
};

// --------------------
export type CategoryCount = {
  category: string;
  count: number;
};

export type SectionCardProps = {
  icon: ReactNode;
  count: number | undefined;
  description: string;
};

export type UrlProps = {
  client_id: number;
  created: boolean;
  date_created: string;
  funnel: number;
  existing_url: boolean;
  include: boolean;
  keyword_focus: string;
  month: number | null;
  page_type: string;
  page_type_frontend: string | null;
  parent_slug: string | null;
  priority: number;
  url: string;
  url_id: number;
  strategy_id: number;
  strategy: {
    id: number;
    client_id: number;
    created_at: string;
    strategy_status: "pending" | "to_aprove" | "approved";
    comment_strategy: string | null;
    strategy_version: number;
  };
};

export type ActivityUrlProps = {
  created: boolean;
  url_id: number;
  url: string;
  date_created: string;
  Content: {
    posted: boolean;
    created_at: string;
  }[];
};

export type IconProps = {
  className?: string;
  colorFill?: string;
  color: string;
};

export type MonthProps = {
  id: number;
  name: string;
  query: string;
};

export type URLTableProps = {
  client_id: number;
  created: boolean;
  date_created: string;
  funnel: number;
  include: boolean;
  keyword_focus: string;
  month: number | null;
  page_type: string;
  page_type_frontend:
    | "informative"
    | "category"
    | "service"
    | "default"
    | null
    | undefined;
  parent_slug: string | null;
  priority: number;
  redirect: string | null;
  url: string;
  url_id: number;
  inspectionData?: {
    indexingVerdict: string;
    httpStatusCode: string;
    error: string | null;
  };
  existing_url: boolean;
};

export type URLDataTableProps = {
  id: number;
  url: string;
  category:
    | "informative"
    | "category"
    | "service"
    | "default"
    | null
    | undefined;
  indexed: string | undefined;
  is_posted: boolean;
  approved_status: string | null;
  improvement: {
    clicks: number;
    impressions: number;
    status: string | null;
    range_start?: string;
    range_end?: string;
    prev_range_start?: string;
    prev_range_end?: string;
    clicks_prev: number;
    impressions_prev: number;
    direction?: number;
    window_key?: string;
  };
  http_status: PingResult;
  month: number | null;
  actions?: URLTableProps;
  existing_url: boolean;
  scheduled_at: string;
  Content?: [{ posted: boolean }];
};

export type PingResult = {
  exists: boolean;
  status?: number;
  message: string;
};
