diff --git a/src/views/Generator/GeneratorDrawer/RuleEditor/RuleEditor.tsx b/src/views/Generator/GeneratorDrawer/RuleEditor/RuleEditor.tsx index 6c745c27..e9dc627d 100644 --- a/src/views/Generator/GeneratorDrawer/RuleEditor/RuleEditor.tsx +++ b/src/views/Generator/GeneratorDrawer/RuleEditor/RuleEditor.tsx @@ -4,6 +4,7 @@ import { CorrelationEditor } from './CorrelationEditor' import { CustomCodeEditor } from './CustomCodeEditor' import { Box, Callout, IconButton } from '@radix-ui/themes' import { Cross2Icon, InfoCircledIcon } from '@radix-ui/react-icons' +import { useNavigate } from 'react-router-dom' export function RuleEditorSwitch() { const rule = useGeneratorStore(selectSelectedRule) @@ -34,19 +35,20 @@ export function RuleEditorSwitch() { } export function RuleEditor() { + const navigate = useNavigate() const selectRule = useGeneratorStore((store) => store.selectRule) const selectedRuleId = useGeneratorStore((store) => store.selectedRuleId) + const handleClose = () => { + selectRule(null) + navigate('/generator') + } + return ( {selectedRuleId && ( - selectRule(null)} - > +