import Bg from "@assets/campaigns/monad/bg.png";
import Icon from "@assets/campaigns/monad/icon.png";
import { NATIVE_TOKEN_ADDRESS } from "@utils/constants";
import { resolveSvg } from "@utils/resolveSvg";
export interface Campaign {
	id: string;
	title: string;
	description: string;
	link: string;
	chainId: number;
	btnClick?: () => void; // Optional property
	icon?: string;
	backgroundImage?: string;
	swapNowFn?: () => void;
	backgroundImageClassName?: string;
}

export const campaigns: Campaign[] = [
	{
		id: "monad-launch",
		title: "Are you $MON Believer or Dumper?",
		description: "$2,000 in rewards. Pick your side with every $MON swap.",
		link: "https://blog.bungee.exchange/monad-is-here-2-000-in-rewards-for-believers-vs-dumpers-728e78fac2c6",
		chainId: 143,
		icon: resolveSvg(Icon as unknown as { src: string }),
		backgroundImage: resolveSvg(Bg as unknown as { src: string }),
		backgroundImageClassName: "bn-w-2/3 bn-right-0 bn-inset-y-0 bn-my-auto",
	},
];

interface CampaignConfig {
	startTime?: number;
	endTime: number;
	eligibleTokens: Array<{
		address: string;
		chainId: number;
		side: "source" | "destination" | "both";
	}>;
}

// Campaign configuration with end time and eligible tokens
export const CAMPAIGN_CONFIG: Record<string, CampaignConfig> = {
	"follow-the-fox": {
		endTime: 1762174800, // 3rd November - 1PM UTC (in seconds)
		eligibleTokens: [
			{
				address: "0x1789e0043623282d5dcc7f213d703c6d8bafbb04", // Linea token
				chainId: 59144, // Linea chain
				side: "both",
			},
			{
				address: "0xaca92e438df0b2401ff60da7e4337b687a2435da", // mUSD token
				chainId: 59144, // Linea chain
				side: "both",
			},
		],
	},

	"monad-launch": {
		startTime: 1763998200, // 24th Nov, 3:30 PM UTC (is seconds)
		endTime: 1764257400, // 27th November - 3:30 PM UTC (in seconds)
		eligibleTokens: [
			{
				address: NATIVE_TOKEN_ADDRESS,
				chainId: 143, // Monad
				side: "both",
			},
		],
	},
};

export const CAMPAIGN_TIMES: Record<string, number> = Object.fromEntries(
	Object.entries(CAMPAIGN_CONFIG).map(([id, config]) => [id, config.endTime]),
);
