// axi0 Motion 0.2.0: Gradient text. The text fills with colors that flow slowly along it.
// Generated from src/gradient-text/meta.json by motion-pack: a thin wrapper. The loader (motion.js) must be on the page once;
// it starts the effect on the element this renders. Options left out keep the effect's own defaults.
import { createElement } from "react";
import type { HTMLAttributes, ReactNode } from "react";

export interface GradientTextProps extends HTMLAttributes<HTMLElement> {
  /** two or more colors, comma separated (default "#f6a04d,#ff6b8b,#8a7dff") */
  colors?: string;
  /** seconds per loop (default 6) */
  speed?: number;
  /** The element to render (default "div") */
  as?: string;
  children?: ReactNode;
}

const s = (v: unknown) => (v === undefined ? undefined : String(v));

export function GradientText({ as = "div", colors, speed, ...rest }: GradientTextProps) {
  return createElement(as, { ...rest, "data-motion": "gradient-text", "data-motion-colors": s(colors), "data-motion-speed": s(speed) });
}

export default GradientText;
