export type SummaryOption = { key: string; label: string; type: string };
export type Filter = {
  title: string;
  filter_key: string;
  source_key: string;
  by_more: number;
};
export type Summary = {
  title: string;
  key: string;
  options: SummaryOption[];
};
export type Tag = {
  قانون: string;
  عنوان: string;
  متن: string;
  ماده: string;
  نوع: string;
  سال: string;
  دسته: string;
  مصوب: string;
  تاریخ: string;
};
export type Domain = {
  label: string;
  tag: string;
  key: string;
  field_collapse: string;
  table_actions: TableActions[];
  table_columns: TableColumns;
};

export type DomainItem = {
  label: string;
  tag: string;
  key: string;
  field_collapse: string;
  table_actions: TableActions[];
  table_columns: TableColumns[];
};

export type baseTableAction = {
  title: string;
  key: string;
  "v-can": string;
  icon: string;
  type: string;
  link_route?: {
    id: string;
    name: string;
    key: string;
  };
  toggle_icons?: { icon1: string; icon2: string };
};
export type TableActions = [
  baseTableAction & {
    api_items: {
      data_type: string;
      ref_key: string;
      id: string;
      title: string;
    };
  }
];
export type TableColumnItem = {
  key: string;
  title: string;
  width: string;
  textAlign?: string;
  isLink?: true;
  link_route?: { id: string; name: string; key: string };
  trancate_word?: number;
  colors?: {
    منسوخه: string;
    معتبر: string;
    موقت: string;
    "بااجرامنتفي مي شود": string;
    تمديد: string;
    آزمايشي: string;
    تنفيذ: string;
  };
};

export type TableColumns = TableColumnItem[];

export type Advance = {
  key: string;
  label: string;
  tag: string;
  type: string;
  placeholder: string;
  labelClass: string;
  inputClass: string;
  multi_select: string;
  options?: [{ value: string; title: string }];
};
export type SearchType = {
  key: string;
  description?: string;
  label: string;
  item?: {
    label: string;
    type: string;
    component: string;
  };
};
export type SearchContentActions = {
  icon?: "";
  title: string;
  key: string;
  type: string;
  "v-can": string;

  api_items?: {
    data_type: string;
    ref_key: string;
    id: string;
    title: string;
  };
  toggle_icons?: { icon1: string; icon2: string };
};

export type Item = {
  key: string;
  source_key: string;
  label: string;
  style: string;
  process?: string;

  link_route?: {
    id: string;
    name: string;
    key: string;
  };
};
export type Items = {
  key: string;
  items: Item[];
  array_key: string;
};

export type SearchContentCollapseItems = {
  key: string;
  items: Items[];
};
export type ListItem = {
  title: string;
  list_key: string;
  filter_key: string;
  icon: string;
};
export type List = ListItem[];
// search
export type searchActiveTab = {
  key: string;
  label: string;
  key_navbar:string;
  description: string;
  routeName: string;
  searchContent: string;
  showTableList: number;
  summary: Summary;
  filter: Filter[];
  domain: {
    tags: Tag;
    domain: Domain[] | [];
  }|{};
  advance: Advance[];
  searchType: SearchType[];
  search_content: {
    actions: SearchContentActions[];
    collapse_items: SearchContentCollapseItems;
  };
  lists: List;
  colors_qanon_etebar: {
    منسوخه: "red";
    معتبر: "green";
    موقت: "blue";
    "بااجرامنتفي مي شود": "blue";
    تمديد: "coral";
    آزمايشي: "blue";
    تنفيذ: "coral";
  };
}| undefined;
export type searchSchema = searchActiveTab[];
export type searchActiveSchema = [];

// search list
export type searchChartSchemaItem = {
  key: string;
  label: string;
  description: string;
  routeName: string;
  searchContent: string;
  showTableList: number;
  summary: Summary;
  filter: Filter[];
  search_content: {
    actions: SearchContentActions[];
    collapse_items: SearchContentCollapseItems;
  };
  info: {
    title: string;
    index_name: string;
    meta: string;
    table_columns: string;
    table_columns_subject: string;
    entity_view: string;
    lists: [];
    items: [{ name: string; title: string }];
  };
  actions: TableActions;
  items: searchListActiveTab[];
};

export type searchListActiveTabItem = {
  key: string;
  id: number;
  url_GET_item: string;
  key_filter: string;
  label: string;
};
export type searchListActiveTab = {
  key: string;
  label: string;
  field_collapsed: string;
  items: searchListActiveTabItem[];
};

export type searchListSchema = searchChartSchemaItem[];
export type activeSearchListSchema = searchChartSchemaItem;

// search chart
export type searchChartActiveTab = {
  key: string;
  componentName: string;
  label: string;
  chartBase: {
    key: string;
    label: string;
    items: [{ key: string; label: string }];
  };
};
export type searchChartSchema = activeSearchChartSchema[];
export type activeSearchChartSchema = searchActiveTab & {
  items: searchChartSchemaItem[];
};

export type searchSynonymTitle = {};
export type searchSynonymForm = [];
export type selectionFilterItems = [];

export type helpSchema = helpActiveSchema[];
export type helpActiveSchema = {
  key: string;
  label: string;
  title: string;
  comment: string;
};
export type DomainActive = Domain;
