diff --git a/web/app/components/workflow-app/search-params.ts b/web/app/components/workflow-app/search-params.ts new file mode 100644 index 0000000000..c9b814e3b9 --- /dev/null +++ b/web/app/components/workflow-app/search-params.ts @@ -0,0 +1,11 @@ +import { parseAsStringEnum } from 'nuqs' +import { ViewType } from '@/app/components/workflow/types' + +export const parseAsViewType = parseAsStringEnum(Object.values(ViewType)) + .withDefault(ViewType.graph) + .withOptions({ + history: 'replace', + clearOnDefault: true, + }) + +export const WORKFLOW_VIEW_PARAM_KEY = 'view'