import React, { useEffect } from 'react';

const Tracker: React.FC = () => {
    useEffect(() => {
        if (process.env.NODE_ENV === 'production') {
            const script = document.createElement('script');
            script.src = "https://tianji.aimloperations.com/tracker.js";
            script.async = true;
            script.defer = true;
            script.setAttribute('data-website-id', 'cm7x7m52m03kbddswbswrt17y');

            document.body.appendChild(script);

            return () => {
                document.body.removeChild(script);
            };
        }
    }, []);

    return null;
};

export default Tracker;
