/* eslint-disable */ // @ts-nocheck import { Button, ButtonVariant, Form, Modal, ModalVariant, Tooltip, } from "../../../shared/@patternfly/react-core"; import { PencilAltIcon } from "../../../shared/@patternfly/react-icons"; import { useEffect } from "react"; import { FormProvider, useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { TextAreaControl, TextControl } from "../../../shared/keycloak-ui-shared"; import useToggle from "../../utils/useToggle"; import type { ExpandableExecution } from "../execution-model"; type EditFlowProps = { execution: ExpandableExecution; onRowChange: (execution: ExpandableExecution) => void; }; type FormFields = Omit; export const EditFlow = ({ execution, onRowChange }: EditFlowProps) => { const { t } = useTranslation(); const form = useForm({ mode: "onChange", defaultValues: execution, }); const [show, toggle] = useToggle(); useEffect(() => form.reset(execution), [execution]); const onSubmit = (formValues: FormFields) => { onRowChange({ ...execution, ...formValues }); toggle(); }; return ( <> {show && ( {t("edit")} , , ]} isOpen >
)} ); };