import { __extends } from "tslib";
import * as React from 'react';
import { WeeklyDayPicker, DayOfWeek, addDays, defaultWeeklyDayPickerStrings } from '@fluentui/react';
import * as styles from './WeeklyDayPicker.Example.scss';
import { DefaultButton } from '@fluentui/react/lib/Button';
var WeeklyDayPickerInlineExample = /** @class */ (function (_super) {
    __extends(WeeklyDayPickerInlineExample, _super);
    function WeeklyDayPickerInlineExample(props) {
        var _this = _super.call(this, props) || this;
        _this._onSelectDate = function (date) {
            _this.setState(function (prevState) {
                return {
                    selectedDate: date,
                };
            });
        };
        _this._goPrevious = function () {
            if (_this.state && _this.state.selectedDate) {
                _this._onSelectDate(addDays(_this.state.selectedDate, -1));
            }
        };
        _this._goNext = function () {
            if (_this.state && _this.state.selectedDate) {
                _this._onSelectDate(addDays(_this.state.selectedDate, 1));
            }
        };
        _this.state = {
            selectedDate: new Date(),
        };
        return _this;
    }
    WeeklyDayPickerInlineExample.prototype.render = function () {
        return (React.createElement("div", { className: styles.wrapper },
            React.createElement("div", null,
                "Selected date(s):",
                ' ',
                React.createElement("span", null, !this.state.selectedDate ? 'Not set' : this.state.selectedDate.toLocaleString())),
            React.createElement(WeeklyDayPicker, { onSelectDate: this._onSelectDate, firstDayOfWeek: DayOfWeek.Wednesday, strings: defaultWeeklyDayPickerStrings, initialDate: this.state.selectedDate }),
            React.createElement("div", null,
                React.createElement(DefaultButton, { className: styles.button, onClick: this._goPrevious, text: "Previous" }),
                React.createElement(DefaultButton, { className: styles.button, onClick: this._goNext, text: "Next" }))));
    };
    return WeeklyDayPickerInlineExample;
}(React.Component));
export { WeeklyDayPickerInlineExample };
//# sourceMappingURL=WeeklyDayPicker.Inline.Example.js.map