import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment'; import React, {useState} from 'react'; const DocsRating = ({label}) => { if (!ExecutionEnvironment.canUseDOM) { return null; } const [haveVoted, setHaveVoted] = useState(false); const giveFeedback = value => { if (window.ga) { window.ga('send', { hitType: 'event', eventCategory: 'button', eventAction: 'feedback', eventLabel: label, eventValue: value, }); } setHaveVoted(true); }; return (