"use client"; import dynamic from "next/dynamic"; const AnimatedGridBackground = dynamic(() => import("./AnimatedGridBackground"), { ssr: false, loading: () => null }); const CanvasRevealBackground = dynamic(() => import("./CanvasRevealBackground"), { ssr: false, loading: () => null }); const CellWaveBackground = dynamic(() => import("./CellWaveBackground"), { ssr: false, loading: () => null }); const DownwardRaysBackground = dynamic(() => import("./DownwardRaysBackground"), { ssr: false, loading: () => null }); const GlowingOrbBackground = dynamic(() => import("./GlowingOrbBackground"), { ssr: false, loading: () => null }); const GlowingOrbSparklesBackground = dynamic(() => import("./GlowingOrbSparklesBackground"), { ssr: false, loading: () => null }); const GradientBarsBackground = dynamic(() => import("./GradientBarsBackground"), { ssr: false, loading: () => null }); const RadialGradientBackground = dynamic(() => import("./RadialGradientBackground"), { ssr: false, loading: () => null }); const RotatedRaysBackground = dynamic(() => import("./RotatedRaysBackground"), { ssr: false, loading: () => null }); const RotatingGradientBackground = dynamic(() => import("./RotatingGradientBackground"), { ssr: false, loading: () => null }); const SparklesGradientBackground = dynamic(() => import("./SparklesGradientBackground"), { ssr: false, loading: () => null }); export type HeroBackgroundVariant = | "plain" | "animated-grid" | "canvas-reveal" | "cell-wave" | "downward-rays-animated" | "downward-rays-animated-grid" | "downward-rays-static" | "downward-rays-static-grid" | "glowing-orb" | "glowing-orb-sparkles" | "gradient-bars" | "radial-gradient" | "rotated-rays-animated" | "rotated-rays-animated-grid" | "rotated-rays-static" | "rotated-rays-static-grid" | "rotating-gradient" | "sparkles-gradient"; type AnimatedGridProps = React.ComponentProps; type CanvasRevealProps = React.ComponentProps; type CellWaveProps = React.ComponentProps; type GlowingOrbProps = React.ComponentProps; type GlowingOrbSparklesProps = React.ComponentProps; type GradientBarsProps = React.ComponentProps; type RadialGradientProps = React.ComponentProps; type RotatingGradientProps = React.ComponentProps; type SparklesGradientProps = React.ComponentProps; export type HeroBackgroundVariantProps = | { variant: "plain" } | ({ variant: "animated-grid" } & AnimatedGridProps) | ({ variant: "canvas-reveal" } & CanvasRevealProps) | ({ variant: "cell-wave" } & CellWaveProps) | { variant: "downward-rays-animated" } | { variant: "downward-rays-animated-grid" } | { variant: "downward-rays-static" } | { variant: "downward-rays-static-grid" } | ({ variant: "glowing-orb" } & GlowingOrbProps) | ({ variant: "glowing-orb-sparkles" } & GlowingOrbSparklesProps) | ({ variant: "gradient-bars" } & GradientBarsProps) | ({ variant: "radial-gradient" } & RadialGradientProps) | { variant: "rotated-rays-animated" } | { variant: "rotated-rays-animated-grid" } | { variant: "rotated-rays-static" } | { variant: "rotated-rays-static-grid" } | ({ variant: "rotating-gradient" } & RotatingGradientProps) | ({ variant: "sparkles-gradient" } & SparklesGradientProps); const heroBackgroundComponents = { "animated-grid": AnimatedGridBackground, "canvas-reveal": CanvasRevealBackground, "cell-wave": CellWaveBackground, "downward-rays": DownwardRaysBackground, "glowing-orb": GlowingOrbBackground, "glowing-orb-sparkles": GlowingOrbSparklesBackground, "gradient-bars": GradientBarsBackground, "radial-gradient": RadialGradientBackground, "rotated-rays": RotatedRaysBackground, "rotating-gradient": RotatingGradientBackground, "sparkles-gradient": SparklesGradientBackground, } as const; const HeroBackgrounds = (props: HeroBackgroundVariantProps) => { if (props.variant === "plain") { return null; } const { variant, ...restProps } = props; // Handle rotated-rays preset variants if (variant === "rotated-rays-animated") { return ; } if (variant === "rotated-rays-animated-grid") { return ; } if (variant === "rotated-rays-static") { return ; } if (variant === "rotated-rays-static-grid") { return ; } // Handle downward-rays preset variants if (variant === "downward-rays-animated") { return ; } if (variant === "downward-rays-animated-grid") { return ; } if (variant === "downward-rays-static") { return ; } if (variant === "downward-rays-static-grid") { return ; } const BackgroundComponent = heroBackgroundComponents[variant]; return ; }; export default HeroBackgrounds;