var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React from 'react';
import { Field } from '../utilities/form';
import { FluentTextFieldAutoComplete } from '../UI/inputs/textField/FluentTextFieldAutoComplete';
import { FluentDialog } from '../UI/feedback/FluentDialog';
import { useTranslation } from 'react-i18next';
import { useForm } from 'react-final-form';
export const ExecuteApiDialog = (props) => {
    const { open, handleCloseDialog, actionLabel = 'Execute', title = 'Execute the below Api', message, apiMethods = [] } = props, other = __rest(props, ["open", "handleCloseDialog", "actionLabel", "title", "message", "apiMethods"]);
    const form = useForm();
    const { t } = useTranslation();
    const handleSubmit = () => {
        form.submit();
    };
    return (React.createElement("div", null, React.createElement(FluentDialog, Object.assign({ open: open, title: title, actionOne: handleCloseDialog, actionTwo: handleSubmit, labelOne: t('Cancel'), labelTwo: actionLabel, onClose: handleCloseDialog, message: message, maxWidth: "sm" }, other), React.createElement(Field, { component: FluentTextFieldAutoComplete, label: t('Api(s)'), id: "apis", name: "apiMethod", fullWidth: true, variant: "outlined", margin: "normal", size: "small", options: apiMethods || [], initialValue: apiMethods[0] || null, required: true, optionKey: "name" }))));
};
//# sourceMappingURL=ExecuteApiDialog.js.map