import * as React from 'react';
import { Rating } from '@fluentui/react-next';
import { PrimaryButton } from '@fluentui/react-next/lib/compat/Button';
export var RatingButtonControlledExample = function () {
    var _a = React.useState(5), currentRating = _a[0], setCurrentRating = _a[1];
    var currentRatingToggle = React.useCallback(function () {
        setCurrentRating(function (oldRating) { return (oldRating === 0 ? 5 : 0); });
    }, []);
    var getRatingAriaLabel = React.useCallback(function () { return "Rating value is " + currentRating + " of 5"; }, [currentRating]);
    return (React.createElement("div", null,
        React.createElement(Rating, { rating: currentRating, max: 5, readOnly: true, allowZeroStars: true, getAriaLabel: getRatingAriaLabel, ariaLabelFormat: "Select {0} of {1} stars" }),
        React.createElement(PrimaryButton, { onClick: currentRatingToggle },
            "Click to change rating to ",
            5 - currentRating)));
};
//# sourceMappingURL=Rating.ButtonControlled.Example.js.map