// Type definitions
export interface Price {
  monthly?: number;
  upfront?: number;
}

export interface Discount {
  monthly?: number;
  upfront?: number;
  monthsCount?: number;
}

export interface Item {
  type: string;
  name: string;
  icon?: string;
  image?: string;
  price?: Price;
  isSubitem?: boolean;
  isOptional?: boolean;
  isMandatory?: boolean;
  discount?: Discount;
  monthsFree?: number;
  tooltip?: string;
  badge?: string;
}

const items: Item[] = [
  {
    type: "Paušál",
    name: "Go Data 10",
    icon: "orange-cash",
    price: {
      monthly: 10,
    },
  },
  {
    type: "Paušál",
    name: "Go 20",
    icon: "collective-class-training",
    price: {
      monthly: 20,
    },
  },
  {
    type: "Zariadenie",
    name: "Motorola Moto G8 Plus blue",
    image: "/images/device-mobile.png",
    price: {
      upfront: 10,
    },
    isSubitem: true,
  },
];

const largeItems: Item[] = [
  {
    type: "Paušál",
    name: "Go Data 10",
    price: {
      monthly: 10,
    },
  },
  {
    type: "Paušál",
    name: "Go 20",
    price: {
      monthly: 20,
    },
  },
  {
    type: "Zariadenie",
    name: "Motorola Moto G8 Plus blue",
    price: {
      upfront: 10,
      monthly: 15,
    },
  },
];

const optionalItem: Item = {
  type: "",
  name: "Vyberte si zariadenie s bonusom až 170 €",
  icon: "device-smart-phone",
  isSubitem: true,
  isOptional: true,
};

const deviceItem: Item = {
  type: "Zariadenie",
  name: "Set top box",
  isSubitem: true,
  price: {
    monthly: 2,
  },
  discount: {
    monthly: 2,
  },
  tooltip:
    "Set-top-box umožnuje sledovanie Orange Tv na vašom televízore. Pre každý televízor potrebujete samostatný Set-top box. So zapojením vám pomôže pri zriadení novej služby náš inštalačný technik.",
};

const discount: Item = {
  type: "Zľava",
  badge: "Zľava",
  name: "Extra zľava na mesačný poplatok za internetovú službu",
  icon: "money-box",
  discount: { monthly: 3.5, monthsCount: 20 },
};

const internet: Item = {
  type: "Optický internet",
  name: "Home Optimal Fiber",
  icon: "device-laptop-computer-connected",
  isMandatory: true,
  price: {
    upfront: 19.9,
    monthly: 15,
  },
};

const router: Item = {
  type: "Zariadenie",
  name: "Optický konvertor",
  tooltip:
    "Optický konvertor a Wi-fi router je zariadenie 2v1 a pripojí váš domov do optickej siete Orange.",
  price: {
    upfront: 0,
    monthly: 1,
  },
};

const internetItems: Item[] = [internet, router];

export const discountVisible: Item[] = [
  internet,
  { ...deviceItem, discount: { upfront: 5, monthly: 2 } },
  discount,
];

export const generateTotal: Item[] = [
  { ...internet, discount: { monthly: 5, monthsCount: 10 }, monthsFree: 3 },
  router,
];

export default items;
export { deviceItem, internetItems, largeItems, optionalItem, router };
