import "./index.css"; import { AutomationEditor } from "components/AutomationEditor"; import { DEFAULT_DIMS } from "components/DAGGraph/elements/constants"; import { FC, PropsWithChildren } from "react"; import { AutomationManagerSidebar } from "../Sidebar"; import { useAutomationManagerState, UseAutomationManagerStateArgs, } from "./state"; import Alert from "@mui/material/Alert"; export type AutomationManagerLoadedProps = UseAutomationManagerStateArgs & { onAutomationDelete: (aid: string, eid: string) => void; }; export const AutomationManagerLoaded: FC< PropsWithChildren > = ({ children, onAutomationDelete, ...args }) => { const state = useAutomationManagerState(args); return (
{children} state.addNew()} onAutomationDelete={(aid, eid) => { onAutomationDelete(aid, eid); state.setSelectedAutomationId(null); }} onAutomationUpdate={state.sideBarUpdateAutomation} />
{state.currentAutomationId !== null ? ( state.currentAutomation ? ( ) : (
Failed to find an automation on disk with id{" "} {state.currentAutomationId}.
) ) : ( <> )}
); };