import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2007-2025 GoodData Corporation
import { memo, useMemo } from "react";
import cx from "classnames";
/**
 * @internal
 */
export const Spinner = memo(function Spinner({ className = "" }) {
    const spinnerTicks = useMemo(() => {
        const items = [];
        for (let i = 1; i <= 8; i += 1) {
            const tickClassName = `gd-dot-spinner-${i}`;
            items.push(_jsx("div", { className: tickClassName }, tickClassName));
        }
        return items;
    }, []);
    const spinnerClasses = useMemo(() => cx({
        "gd-dot-spinner": true,
        [className]: !!className,
    }), [className]);
    return _jsx("div", { className: spinnerClasses, children: spinnerTicks });
});
