refactor(web): convert 7 enums to as-const objects (batch 5) (#33960)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Mahmoud Hamdy
2026-03-26 09:50:54 +02:00
committed by GitHub
parent 3e073404cc
commit 8ca54ddf94
9 changed files with 48 additions and 68 deletions

View File

@ -174,7 +174,7 @@ const Right = ({
{currentNodeVar?.var && (
<>
{
[VarInInspectType.environment, VarInInspectType.conversation, VarInInspectType.system].includes(currentNodeVar.nodeType as VarInInspectType) && (
([VarInInspectType.environment, VarInInspectType.conversation, VarInInspectType.system] as VarInInspectType[]).includes(currentNodeVar.nodeType as VarInInspectType) && (
<VariableIconWithColor
variableCategory={currentNodeVar.nodeType as VarInInspectType}
className="size-4"

View File

@ -2,12 +2,14 @@ export const EVENT_WORKFLOW_STOP = 'WORKFLOW_STOP'
export const CHUNK_SCHEMA_TYPES = ['general_structure', 'parent_child_structure', 'qa_structure']
export enum ViewMode {
Code = 'code',
Preview = 'preview',
}
export const ViewMode = {
Code: 'code',
Preview: 'preview',
} as const
export type ViewMode = typeof ViewMode[keyof typeof ViewMode]
export enum PreviewType {
Markdown = 'markdown',
Chunks = 'chunks',
}
export const PreviewType = {
Markdown: 'markdown',
Chunks: 'chunks',
} as const
export type PreviewType = typeof PreviewType[keyof typeof PreviewType]