import GradientBanner from "@/components/effects/gradient-banner";
import MainBanner from "@/components/feat/MainBanner";
import { Button } from "@/components/ui/button";
import Link from "next/link";
import { useState, useEffect } from "react";
import { DialogContent, Dialog } from "@/components/ui/dialog";
import AffiliatePopup from "@/components/misc/AffiliatePopup";
import { Gradient } from "stripe-gradient";
export const defaultBanners: {
bannerSpace: number;
bannerContent: React.ReactNode;
}[] = [
// The affilation banner ALWAYS has to be first.
{
bannerSpace: 2,
bannerContent: (
<>
>
),
},
];
function AffiliateBanner() {
const [isOpen, setOpen] = useState(false);
useEffect(() => {
const gradient = new Gradient();
const initializeGradient = () => {
const canvasElement = document.getElementById(
"gradient-dialog"
) as HTMLCanvasElement;
if (canvasElement) gradient.initGradient("#gradient-dialog");
};
if (isOpen) {
const timeoutId = setTimeout(initializeGradient, 100); // Delay to ensure canvas is ready
return () => clearTimeout(timeoutId); // Cleanup timeout
}
}, [isOpen]);
return (
<>
setOpen(true)} className="cursor-pointer">
CoreBoxx — an official affiliate of MHSF{" "}
Season 3 is out the doors for the best box server on Minehut
>
);
}
export const bannerHooks: (() =>
| { bannerSpace: number; bannerContent: React.ReactNode }
| undefined)[] = [
() => {
if (process.env.NEXT_PUBLIC_VERCEL_ENV !== "production")
return {
bannerSpace: 1,
bannerContent: (
Your not in production!{" "}
),
};
return undefined;
},
];