@@ -323,9 +323,12 @@ export function CreateMenu({ onCreateWorkflow, isCreatingWorkflow = false }: Cre
323323 >
324324 { /* New Workflow */ }
325325 < button
326- className = { cn ( menuItemClassName , isCreatingWorkflow && 'cursor-not-allowed opacity-50' ) }
326+ className = { cn (
327+ menuItemClassName ,
328+ ( isCreatingWorkflow || ! userPermissions . canEdit ) && 'cursor-not-allowed opacity-50'
329+ ) }
327330 onClick = { handleCreateWorkflow }
328- disabled = { isCreatingWorkflow }
331+ disabled = { isCreatingWorkflow || ! userPermissions . canEdit }
329332 >
330333 < Plus className = { iconClassName } />
331334 < span className = { textClassName } >
@@ -335,27 +338,31 @@ export function CreateMenu({ onCreateWorkflow, isCreatingWorkflow = false }: Cre
335338
336339 { /* New Folder */ }
337340 < button
338- className = { cn ( menuItemClassName , isCreating && 'cursor-not-allowed opacity-50' ) }
341+ className = { cn (
342+ menuItemClassName ,
343+ ( isCreating || ! userPermissions . canEdit ) && 'cursor-not-allowed opacity-50'
344+ ) }
339345 onClick = { handleCreateFolder }
340- disabled = { isCreating }
346+ disabled = { isCreating || ! userPermissions . canEdit }
341347 >
342348 < Folder className = { iconClassName } />
343349 < span className = { textClassName } > { isCreating ? 'Creating...' : 'New folder' } </ span >
344350 </ button >
345351
346352 { /* Import Workflow */ }
347- { userPermissions . canEdit && (
348- < button
349- className = { cn ( menuItemClassName , isImporting && 'cursor-not-allowed opacity-50' ) }
350- onClick = { handleImportWorkflow }
351- disabled = { isImporting }
352- >
353- < Download className = { iconClassName } />
354- < span className = { textClassName } >
355- { isImporting ? 'Importing...' : 'Import workflow' }
356- </ span >
357- </ button >
358- ) }
353+ < button
354+ className = { cn (
355+ menuItemClassName ,
356+ ( isImporting || ! userPermissions . canEdit ) && 'cursor-not-allowed opacity-50'
357+ ) }
358+ onClick = { handleImportWorkflow }
359+ disabled = { isImporting || ! userPermissions . canEdit }
360+ >
361+ < Download className = { iconClassName } />
362+ < span className = { textClassName } >
363+ { isImporting ? 'Importing...' : 'Import workflow' }
364+ </ span >
365+ </ button >
359366 </ PopoverContent >
360367 </ Popover >
361368
0 commit comments