import HomeIcon from "../assets/icons/home.svg";
import HomeIconFilled from "../assets/icons/home-filled.svg";
import PaymentsIcon from "../assets/icons/payments.svg";
import PaymentsIconFilled from "../assets/icons/payments-filled.svg";
import ServiceIcon from "../assets/icons/service.svg";
import ServiceIconFilled from "../assets/icons/service-filled.svg";
import BatteryIcon from "../assets/icons/battery.svg";
import BatteryIconFilled from "../assets/icons/battery-filled.svg";
import InfoIcon from "../assets/icons/error.svg";
import WarningIcon from "../assets/icons/warning.svg";
import DangerIcon from "../assets/icons/danger.svg";
import type { BmsState } from "./types";
import { useTranslation } from "react-i18next";

export const BASE_URL =
  "https://eae2-2400-80c0-2001-9c6-50f0-eda-dcd7-4167.ngrok-free.app";

export const STORAGE_KEYS = {
  LANGUAGE: "userLanguage",
  AUTH_TOKEN: "authToken",
  THEME: "appTheme",
};

export const APP_CONFIG = {
  DEFAULT_LANGUAGE: "en",
  SUPPORTED_LANGUAGES: ["en", "hi"],
};

export const useTabConfig = () => {
  const { t } = useTranslation();

  return [
    {
      name: "index",
      title: t("navigation.home"),
      Icon: HomeIcon,
      IconFilled: HomeIconFilled,
      path: "/",
    },
    {
      name: "payments",
      title: t("navigation.payments"),
      Icon: PaymentsIcon,
      IconFilled: PaymentsIconFilled,
      path: "/payments",
    },
    {
      name: "service",
      title: t("navigation.service"),
      Icon: ServiceIcon,
      IconFilled: ServiceIconFilled,
      path: "/service",
    },
    {
      name: "my-battery",
      title: t("navigation.my-battery"),
      Icon: BatteryIcon,
      IconFilled: BatteryIconFilled,
      path: "/my-battery",
    },
  ];
};

export const MESSAGES = {
  AUTHENTICATION: {
    INVALID_TOKEN: "Invalid Token",
    VERIFICATION_FAILED: "Verification failed, try again later",
  },
};

export const ALERT_STYLES = {
  info: {
    backgroundColor: "#E5EBFD",
    icon: InfoIcon,
  },
  warning: {
    backgroundColor: "#FFF2E2",
    icon: WarningIcon,
  },
  danger: {
    backgroundColor: "#FFE9E9",
    icon: DangerIcon,
  },
};

export const SUPPORT = {
  WHATSAPP_NUMBER: "918685846459",
  WHATSAPP_PLACEHOLDER: "Hi, I need help regarding my vehicle.",
  PHONE: "+911234567890",
  EMAIL: "support@vecmocon.com",
  EMAIL_SUBJECT: "Support Request",
  EMAIL_BODY: "Hello,\n\nI need assistance with...",
};

export const BMS_STATE_LABELS: Record<BmsState, string> = {
  0: "Idle",
  1: "Charging",
  [-1]: "Discharging",
};
