/* eslint-disable */ // @ts-nocheck import { useState } from "react"; import { useTranslation } from "react-i18next"; import { Button, Flex, FlexItem, Title, TitleSizes, } from "../../shared/@patternfly/react-core"; import type AuthenticationFlowRepresentation from "@keycloak/keycloak-admin-client/lib/defs/authenticationFlowRepresentation"; import type { AuthenticationProviderRepresentation } from "@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigRepresentation"; import { ListEmptyState } from "../../shared/keycloak-ui-shared"; import { AddStepModal } from "./components/modals/AddStepModal"; import { AddSubFlowModal, Flow } from "./components/modals/AddSubFlowModal"; import "./empty-execution-state.css"; const SECTIONS = ["addExecution", "addSubFlow"] as const; type SectionType = (typeof SECTIONS)[number] | undefined; type EmptyExecutionStateProps = { flow: AuthenticationFlowRepresentation; onAddExecution: (type: AuthenticationProviderRepresentation) => void; onAddFlow: (flow: Flow) => void; }; export const EmptyExecutionState = ({ flow, onAddExecution, onAddFlow, }: EmptyExecutionStateProps) => { const { t } = useTranslation(); const [show, setShow] = useState(); return ( <> {show === "addExecution" && ( { if (type) { onAddExecution(type); } setShow(undefined); }} /> )} {show === "addSubFlow" && ( setShow(undefined)} onConfirm={(newFlow) => { onAddFlow(newFlow); setShow(undefined); }} /> )}
{SECTIONS.map((section) => ( {t(`${section}Title`)}

{t(section)}

))}
); };