"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RequestMethod = void 0;
const tslib_1 = require("tslib");
const ui_kit_1 = require("@stoplight/ui-kit");
const classnames_1 = tslib_1.__importDefault(require("classnames"));
const mobx_react_lite_1 = require("mobx-react-lite");
const React = tslib_1.__importStar(require("react"));
const useRequestMaker_1 = require("../../../hooks/useRequestMaker");
const httpMethods = ['GET', 'PUT', 'POST', 'DELETE', 'OPTIONS', 'HEAD', 'PATCH'];
exports.RequestMethod = mobx_react_lite_1.observer(({ className }) => {
    const requestStore = useRequestMaker_1.useRequestMakerStore('request');
    const onChange = (e) => {
        requestStore.method = e.currentTarget.value.toLowerCase();
    };
    return (React.createElement(ui_kit_1.HTMLSelect, { className: classnames_1.default('RequestMaker__RequestMethod', className), value: requestStore.method.toUpperCase(), options: httpMethods, onChange: onChange, iconProps: {
            icon: 'caret-down',
        }, large: true }));
});
exports.RequestMethod.displayName = 'RequestMaker.RequestMethod';
//# sourceMappingURL=Method.js.map