"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var react_next_1 = require("@fluentui/react-next");
var Button_1 = require("@fluentui/react-next/lib-commonjs/compat/Button");
exports.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(react_next_1.Rating, { rating: currentRating, max: 5, readOnly: true, allowZeroStars: true, getAriaLabel: getRatingAriaLabel, ariaLabelFormat: "Select {0} of {1} stars" }),
        React.createElement(Button_1.PrimaryButton, { onClick: currentRatingToggle },
            "Click to change rating to ",
            5 - currentRating)));
};
//# sourceMappingURL=Rating.ButtonControlled.Example.js.map