/**
 * @license MIT
 * author: Cube Dev Team
 * @cube-dev/ui-kit v0.108.1
 * Released under the MIT license.
 */

import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
import { createContext, useContext, useMemo } from 'react';
export const TrackingContext = createContext({
    event() {
        // noop
    },
});
export function TrackingProvider({ children, event, }) {
    const tracking = useMemo(() => ({ event }), [event]);
    if (!event)
        return _jsx(_Fragment, { children: children });
    return (_jsx(TrackingContext.Provider, { value: tracking, children: children }));
}
export function useTracking() {
    const tracking = useContext(TrackingContext);
    return tracking;
}

        