import { ConfigProvider } from "antd";
import classNames from "classnames";
import React, { useContext } from "react";
import { useGradientTextStyle } from "./style";
export function GradientText(param) {
    var children = param.children, _param_className = param.className, className = _param_className === void 0 ? '' : _param_className, _param_colors = param.colors, colors = _param_colors === void 0 ? [
        '#40ffaa',
        '#4079ff',
        '#40ffaa',
        '#4079ff',
        '#40ffaa'
    ] : _param_colors, _param_animationSpeed = param.animationSpeed, animationSpeed = _param_animationSpeed === void 0 ? 8 : _param_animationSpeed, style = param.style;
    var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
    var prefixCls = getPrefixCls('gradient-text');
    var _useGradientTextStyle = useGradientTextStyle(prefixCls), wrapSSR = _useGradientTextStyle.wrapSSR, hashId = _useGradientTextStyle.hashId;
    var gradientStyle = {
        backgroundImage: "linear-gradient(to right, ".concat(colors.join(', '), ")"),
        animationDuration: "".concat(animationSpeed, "s")
    };
    return wrapSSR(/*#__PURE__*/ React.createElement("div", {
        className: classNames(prefixCls, hashId, className),
        style: style
    }, /*#__PURE__*/ React.createElement("div", {
        className: classNames("".concat(prefixCls, "-text-content"), hashId),
        style: gradientStyle
    }, children)));
}
