import { ReactElement, LazyExoticComponent, ReactNode } from "react";
import { Mark_State, Payment_type, term_type } from "./Item";
import { ABILITIES_ENUM, ABILITIES_VALUES_ENUM } from "../enums/abilities";
import { UserTypeEnum } from "../enums/UserType";

export type ChildrenType = {
  children: ReactNode;
};

type TMenuItemBase = {
  icon: JSX.Element;
  text: string;
  header?: string;
  title?: string;
  withOutLayout?: boolean;
  abilities: ABILITIES_ENUM;
  abilities_value: ABILITIES_VALUES_ENUM;
  type?:UserTypeEnum
  prevPath: number;
};

type TMenuItemWithDropdown = TMenuItemBase & {
  path: string;
  element?: ReactElement | LazyExoticComponent<any>;
  children: TMenuItem[];
};

type TMenuItemWithoutDropdown = TMenuItemBase & {
  path: string;
  element: ReactElement | LazyExoticComponent<any>;
  children?: TMenuItem[];
};

export type TMenuItem = TMenuItemWithDropdown | TMenuItemWithoutDropdown;

export type TCrudRoute = {
  header?: string;
  path: string;
  element: ReactElement | LazyExoticComponent<any>;
  abilities: ABILITIES_ENUM;
  abilities_value: ABILITIES_VALUES_ENUM;
  type?:ABILITIES_ENUM
  prevPath: number;
};

export interface CardData {
  title: string;
  value: string;
  subTitle: string;
  percentage: number;
  Good?: boolean;
}

export const nationalities: { value: string; label: string }[] = [
  { label: "select.nationalities.Afghan", value: "Afghan" },
  { label: "select.nationalities.Albanian", value: "Albanian" },
  { label: "select.nationalities.Algerian", value: "Algerian" },
  { label: "select.nationalities.American", value: "American" },
  { label: "select.nationalities.Andorran", value: "Andorran" },
  { label: "select.nationalities.Angolan", value: "Angolan" },
  { label: "select.nationalities.Antiguans", value: "Antiguans" },
  { label: "select.nationalities.Argentinean", value: "Argentinean" },
  { label: "select.nationalities.Armenian", value: "Armenian" },
  { label: "select.nationalities.Australian", value: "Australian" },
  { label: "select.nationalities.Austrian", value: "Austrian" },
  { label: "select.nationalities.Azerbaijani", value: "Azerbaijani" },
  { label: "select.nationalities.Bahamian", value: "Bahamian" },
  { label: "select.nationalities.Bahraini", value: "Bahraini" },
  { label: "select.nationalities.Bangladeshi", value: "Bangladeshi" },
  { label: "select.nationalities.Barbadian", value: "Barbadian" },
  { label: "select.nationalities.Barbudans", value: "Barbudans" },
  { label: "select.nationalities.Batswana", value: "Batswana" },
  { label: "select.nationalities.Belarusian", value: "Belarusian" },
  { label: "select.nationalities.Belgian", value: "Belgian" },
  { label: "select.nationalities.Belizean", value: "Belizean" },
  { label: "select.nationalities.Beninese", value: "Beninese" },
  { label: "select.nationalities.Bhutanese", value: "Bhutanese" },
  { label: "select.nationalities.Bolivian", value: "Bolivian" },
  { label: "select.nationalities.Bosnian", value: "Bosnian" },
  { label: "select.nationalities.Brazilian", value: "Brazilian" },
  { label: "select.nationalities.British", value: "British" },
  { label: "select.nationalities.Bruneian", value: "Bruneian" },
  { label: "select.nationalities.Bulgarian", value: "Bulgarian" },
  { label: "select.nationalities.Burkinabe", value: "Burkinabe" },
  { label: "select.nationalities.Burmese", value: "Burmese" },
  { label: "select.nationalities.Burundian", value: "Burundian" },
  { label: "select.nationalities.Cambodian", value: "Cambodian" },
  { label: "select.nationalities.Cameroonian", value: "Cameroonian" },
  { label: "select.nationalities.Canadian", value: "Canadian" },
  { label: "select.nationalities.Cape Verdean", value: "Cape Verdean" },
  { label: "select.nationalities.Central African", value: "Central African" },
  { label: "select.nationalities.Chadian", value: "Chadian" },
  { label: "select.nationalities.Chilean", value: "Chilean" },
  { label: "select.nationalities.Chinese", value: "Chinese" },
  { label: "select.nationalities.Colombian", value: "Colombian" },
  { label: "select.nationalities.Comoran", value: "Comoran" },
  { label: "select.nationalities.Congolese", value: "Congolese" },
  { label: "select.nationalities.Costa Rican", value: "Costa Rican" },
  { label: "select.nationalities.Croatian", value: "Croatian" },
  { label: "select.nationalities.Cuban", value: "Cuban" },
  { label: "select.nationalities.Cypriot", value: "Cypriot" },
  { label: "select.nationalities.Czech", value: "Czech" },
  { label: "select.nationalities.Danish", value: "Danish" },
  { label: "select.nationalities.Djibouti", value: "Djibouti" },
  { label: "select.nationalities.Dominican", value: "Dominican" },
  { label: "select.nationalities.Dutch", value: "Dutch" },
  { label: "select.nationalities.East Timorese", value: "East Timorese" },
  { label: "select.nationalities.Ecuadorean", value: "Ecuadorean" },
  { label: "select.nationalities.Egyptian", value: "Egyptian" },
  { label: "select.nationalities.Emirian", value: "Emirian" },
  {
    label: "select.nationalities.Equatorial Guinean",
    value: "Equatorial Guinean",
  },
  { label: "select.nationalities.Eritrean", value: "Eritrean" },
  { label: "select.nationalities.Estonian", value: "Estonian" },
  { label: "select.nationalities.Ethiopian", value: "Ethiopian" },
  { label: "select.nationalities.Fijian", value: "Fijian" },
  { label: "select.nationalities.Filipino", value: "Filipino" },
  { label: "select.nationalities.Finnish", value: "Finnish" },
  { label: "select.nationalities.French", value: "French" },
  { label: "select.nationalities.Gabonese", value: "Gabonese" },
  { label: "select.nationalities.Gambian", value: "Gambian" },
  { label: "select.nationalities.Georgian", value: "Georgian" },
  { label: "select.nationalities.German", value: "German" },
  { label: "select.nationalities.Ghanaian", value: "Ghanaian" },
  { label: "select.nationalities.Greek", value: "Greek" },
  { label: "select.nationalities.Grenadian", value: "Grenadian" },
  { label: "select.nationalities.Guatemalan", value: "Guatemalan" },
  { label: "select.nationalities.Guinea-Bissauan", value: "Guinea-Bissauan" },
  { label: "select.nationalities.Guinean", value: "Guinean" },
  { label: "select.nationalities.Guyanese", value: "Guyanese" },
  { label: "select.nationalities.Haitian", value: "Haitian" },
  { label: "select.nationalities.Herzegovinian", value: "Herzegovinian" },
  { label: "select.nationalities.Honduran", value: "Honduran" },
  { label: "select.nationalities.Hungarian", value: "Hungarian" },
  { label: "select.nationalities.I-Kiribati", value: "I-Kiribati" },
  { label: "select.nationalities.Icelander", value: "Icelander" },
  { label: "select.nationalities.Indian", value: "Indian" },
  { label: "select.nationalities.Indonesian", value: "Indonesian" },
  { label: "select.nationalities.Iranian", value: "Iranian" },
  { label: "select.nationalities.Iraqi", value: "Iraqi" },
  { label: "select.nationalities.Irish", value: "Irish" },
  { label: "select.nationalities.Palestine", value: "Palestine" },
  { label: "select.nationalities.Italian", value: "Italian" },
  { label: "select.nationalities.Ivorian", value: "Ivorian" },
  { label: "select.nationalities.Jamaican", value: "Jamaican" },
  { label: "select.nationalities.Japanese", value: "Japanese" },
  { label: "select.nationalities.Jordanian", value: "Jordanian" },
  { label: "select.nationalities.Kazakhstani", value: "Kazakhstani" },
  { label: "select.nationalities.Kenyan", value: "Kenyan" },
  {
    label: "select.nationalities.Kittian and Nevisian",
    value: "Kittian and Nevisian",
  },
  { label: "select.nationalities.Kuwaiti", value: "Kuwaiti" },
  { label: "select.nationalities.Kyrgyz", value: "Kyrgyz" },
  { label: "select.nationalities.Laotian", value: "Laotian" },
  { label: "select.nationalities.Latvian", value: "Latvian" },
  { label: "select.nationalities.Lebanese", value: "Lebanese" },
  { label: "select.nationalities.Liberian", value: "Liberian" },
  { label: "select.nationalities.Libyan", value: "Libyan" },
  { label: "select.nationalities.Liechtensteiner", value: "Liechtensteiner" },
  { label: "select.nationalities.Lithuanian", value: "Lithuanian" },
  { label: "select.nationalities.Luxembourger", value: "Luxembourger" },
  { label: "select.nationalities.Macedonian", value: "Macedonian" },
  { label: "select.nationalities.Malagasy", value: "Malagasy" },
  { label: "select.nationalities.Malawian", value: "Malawian" },
  { label: "select.nationalities.Malaysian", value: "Malaysian" },
  { label: "select.nationalities.Maldivan", value: "Maldivan" },
  { label: "select.nationalities.Malian", value: "Malian" },
  { label: "select.nationalities.Maltese", value: "Maltese" },
  { label: "select.nationalities.Marshallese", value: "Marshallese" },
  { label: "select.nationalities.Mauritanian", value: "Mauritanian" },
  { label: "select.nationalities.Mauritian", value: "Mauritian" },
  { label: "select.nationalities.Mexican", value: "Mexican" },
  { label: "select.nationalities.Micronesian", value: "Micronesian" },
  { label: "select.nationalities.Moldovan", value: "Moldovan" },
  { label: "select.nationalities.Monacan", value: "Monacan" },
  { label: "select.nationalities.Mongolian", value: "Mongolian" },
  { label: "select.nationalities.Moroccan", value: "Moroccan" },
  { label: "select.nationalities.Mosotho", value: "Mosotho" },
  { label: "select.nationalities.Motswana", value: "Motswana" },
  { label: "select.nationalities.Mozambican", value: "Mozambican" },
  { label: "select.nationalities.Namibian", value: "Namibian" },
  { label: "select.nationalities.Nauruan", value: "Nauruan" },
  { label: "select.nationalities.Nepali", value: "Nepali" },
  { label: "select.nationalities.New Zealander", value: "New Zealander" },
  { label: "select.nationalities.Nicaraguan", value: "Nicaraguan" },
  { label: "select.nationalities.Nigerian", value: "Nigerian" },
  { label: "select.nationalities.Nigerien", value: "Nigerien" },
  { label: "select.nationalities.North Korean", value: "North Korean" },
  { label: "select.nationalities.Northern Irish", value: "Northern Irish" },
  { label: "select.nationalities.Norwegian", value: "Norwegian" },
  { label: "select.nationalities.Omani", value: "Omani" },
  { label: "select.nationalities.Pakistani", value: "Pakistani" },
  { label: "select.nationalities.Palauan", value: "Palauan" },
  { label: "select.nationalities.Panamanian", value: "Panamanian" },
  {
    label: "select.nationalities.Papua New Guinean",
    value: "Papua New Guinean",
  },
  { label: "select.nationalities.Paraguayan", value: "Paraguayan" },
  { label: "select.nationalities.Peruvian", value: "Peruvian" },
  { label: "select.nationalities.Polish", value: "Polish" },
  { label: "select.nationalities.Portuguese", value: "Portuguese" },
  { label: "select.nationalities.Qatari", value: "Qatari" },
  { label: "select.nationalities.Romanian", value: "Romanian" },
  { label: "select.nationalities.Russian", value: "Russian" },
  { label: "select.nationalities.Rwandan", value: "Rwandan" },
  { label: "select.nationalities.Saint Lucian", value: "Saint Lucian" },
  { label: "select.nationalities.Salvadoran", value: "Salvadoran" },
  { label: "select.nationalities.Samoan", value: "Samoan" },
  { label: "select.nationalities.San Marinese", value: "San Marinese" },
  { label: "select.nationalities.Sao Tomean", value: "Sao Tomean" },
  { label: "select.nationalities.Saudi", value: "Saudi" },
  { label: "select.nationalities.Scottish", value: "Scottish" },
  { label: "select.nationalities.Senegalese", value: "Senegalese" },
  { label: "select.nationalities.Serbian", value: "Serbian" },
  { label: "select.nationalities.Seychellois", value: "Seychellois" },
  { label: "select.nationalities.Sierra Leonean", value: "Sierra Leonean" },
  { label: "select.nationalities.Singaporean", value: "Singaporean" },
  { label: "select.nationalities.Slovakian", value: "Slovakian" },
  { label: "select.nationalities.Slovenian", value: "Slovenian" },
  { label: "select.nationalities.Solomon Islander", value: "Solomon Islander" },
  { label: "select.nationalities.Somali", value: "Somali" },
  { label: "select.nationalities.South African", value: "South African" },
  { label: "select.nationalities.South Korean", value: "South Korean" },
  { label: "select.nationalities.Spanish", value: "Spanish" },
  { label: "select.nationalities.Sri Lankan", value: "Sri Lankan" },
  { label: "select.nationalities.Sudanese", value: "Sudanese" },
  { label: "select.nationalities.Surinamer", value: "Surinamer" },
  { label: "select.nationalities.Swazi", value: "Swazi" },
  { label: "select.nationalities.Swedish", value: "Swedish" },
  { label: "select.nationalities.Swiss", value: "Swiss" },
  { label: "select.nationalities.Syrian", value: "Syrian" },
  { label: "select.nationalities.Taiwanese", value: "Taiwanese" },
  { label: "select.nationalities.Tajik", value: "Tajik" },
  { label: "select.nationalities.Tanzanian", value: "Tanzanian" },
  { label: "select.nationalities.Thai", value: "Thai" },
  { label: "select.nationalities.Togolese", value: "Togolese" },
  { label: "select.nationalities.Tongan", value: "Tongan" },
  {
    label: "select.nationalities.Trinidadian/Tobagonian",
    value: "Trinidadian/Tobagonian",
  },
  { label: "select.nationalities.Tunisian", value: "Tunisian" },
  { label: "select.nationalities.Turkish", value: "Turkish" },
  { label: "select.nationalities.Tuvaluan", value: "Tuvaluan" },
  { label: "select.nationalities.Ugandan", value: "Ugandan" },
  { label: "select.nationalities.Ukrainian", value: "Ukrainian" },
  { label: "select.nationalities.Uruguayan", value: "Uruguayan" },
  { label: "select.nationalities.Uzbekistani", value: "Uzbekistani" },
  { label: "select.nationalities.Venezuelan", value: "Venezuelan" },
  { label: "select.nationalities.Vietnamese", value: "Vietnamese" },
  { label: "select.nationalities.Welsh", value: "Welsh" },
  { label: "select.nationalities.Yemenite", value: "Yemenite" },
  { label: "select.nationalities.Zambian", value: "Zambian" },
  { label: "select.nationalities.Zimbabwean", value: "Zimbabwean" },
];

export const Term_Select: { value: term_type; label: string }[] = [
  { value: "first", label: "الأول" },
  { value: "second", label: "الثاني" },
];

interface Note {
  label: string;
  value: string;
  color: string;
}

export const notes: Note[] = [
  { label: "select.Note.normal_note", value: "normal_note", color: "yellow" }, // Normal Note
  { label: "select.Note.alert_note", value: "alert_note", color: "yellow" }, // Alert Note
  {
    label: "select.Note.financial_note",
    value: "financial_note",
    color: "yellow",
  }, // Financial Note
  {
    label: "select.Note.positive_note",
    value: "positive_note",
    color: "green",
  }, // Positive Note
  { label: "select.Note.warning_note", value: "warning_note", color: "red" }, // Warning Note
  {
    label: "select.Note.academic_note",
    value: "academic_note",
    color: "yellow",
  }, // Academic Note
  {
    label: "select.Note.studying_note",
    value: "studying_note",
    color: "yellow",
  }, // Studying Note
  {
    label: "select.Note.organization_note",
    value: "orgnaization_note",
    color: "yellow",
  }, // Organization Note
];

export const Payments: { label: string; value: Payment_type | "" }[] = [
  { label: "select.Payments.paid", value: "paid" },
  { label: "select.Payments.to_be_paid", value: "to_be_paid" },
];

export const Marks: { value: Mark_State; label: string }[] = [
  { value: "Not_Taken", label: "Not_Taken" },
  { value: "Taken", label: "Taken" },
];

export type Sex = "male" | "female" | "bi";

export const Sex_Select_options: { value: Sex; label: string }[] = [
  { value: "male", label: "select.Sex.male" },
  { value: "female", label: "select.Sex.female" },
  { value: "bi", label: "select.Sex.bi" },
];

export const Sex_Select_options_Student: { value: Sex; label: string }[] = [
  { value: "male", label: "select.Sex.male" },
  { value: "female", label: "select.Sex.female" },
];

export type religion = "muslim" | "christianity" | "other";

export const religion_Select_options: { value: religion; label: string }[] = [
  { value: "muslim", label: "select.Religion.muslim" },
  { value: "christianity", label: "select.Religion.christianity" },
  { value: "other", label: "select.Religion.other" },
];

export interface Branch {
  id: number;
  name: string;
  address: string;
  meta: {
    test: number;
  };
  created_at: string; // ISO 8601 date string
  updated_at: string; // ISO 8601 date string
}

export interface Role {
  id: number;
  name: string;
}

export interface Cycle {
  id: number;
  starting_date: string; // ISO 8601 date string
  ending_date: string; // ISO 8601 date string
  branch_id: number;
  name: string;
  status: string; // Consider using a string literal type for status if it has specific values
}

export interface Term {
  id: number;
  cycle_id: number;
  ending_date: string; // ISO 8601 date string
  starting_date: string; // ISO 8601 date string
  term_type: term_type;
  description: string | null;
  current_term: boolean;
}

export const Term_type: { value: term_type; label: string }[] = [
  { value: "first", label: "select.Term_type.first" },
  { value: "second", label: "select.Term_type.second" },
  { value: "summer", label: "select.Term_type.summer" },
  { value: "extra", label: "select.Term_type.extra" },
];

export interface Ability {
  id: number;
  name: string;
}
export type admin_type = "admin" | "branchAdmin";
export type active_type = "active" | "suspend";

export interface Admin {
  id: number;
  username: string;
  email: string;
  type: admin_type; // Update the types as needed
  status: active_type; // Update the statuses as needed
  shouldRechangePassword: boolean;
  created_at: string;
  updated_at: string;
}

export const Admin_type: { value: admin_type; label: string }[] = [
  { value: "admin", label: "select.Admin_type.admin" },
  { value: "branchAdmin", label: "select.Admin_type.branchAdmin" },
];

export interface BranchRole {
  role: Role;
  branch: Branch;
}

export interface showAdmin {
  user: Admin;
  branches: BranchRole[];
}

export type Nullable<T> = { [K in keyof T]: T[K] | null };
