sozsoft-platform/ui/src/utils/workflow/workflowConstants.ts

32 lines
863 B
TypeScript
Raw Normal View History

2026-08-14 11:32:31 +00:00
import { FiBell, FiCheck, FiGitBranch, FiPlay, FiSlash } from 'react-icons/fi'
2026-05-22 09:40:35 +00:00
export const kindOptions = [
2026-08-17 05:56:52 +00:00
{ value: 'Start', label: 'App.WorkflowKind.Start' },
{ value: 'Compare', label: 'App.WorkflowKind.Compare' },
{ value: 'Approval', label: 'App.WorkflowKind.Approval' },
{ value: 'Inform', label: 'App.WorkflowKind.Inform' },
{ value: 'End', label: 'App.WorkflowKind.End' },
2026-08-14 11:32:31 +00:00
]
2026-05-22 09:40:35 +00:00
2026-08-14 11:32:31 +00:00
export const operatorOptions = ['>', '>=', '<', '<=', '=', '!='].map((value) => ({
value,
label: value,
}))
2026-05-22 09:40:35 +00:00
2026-05-22 11:50:09 +00:00
export const kindIcon: Record<string, any> = {
2026-05-22 09:40:35 +00:00
Start: FiPlay as any,
Compare: FiGitBranch as any,
Approval: FiCheck as any,
Inform: FiBell as any,
End: FiSlash as any,
2026-08-14 11:32:31 +00:00
}
2026-05-22 09:40:35 +00:00
export const nodeSize = {
width: 176,
height: 128,
2026-08-14 11:32:31 +00:00
}
2026-05-22 09:40:35 +00:00
export function getNodeHeight(item: { kind: string }) {
2026-08-14 11:32:31 +00:00
return item?.kind === 'Compare' ? 158 : nodeSize.height
2026-05-22 09:40:35 +00:00
}