fix(deploy): fix button (#1949)

This commit is contained in:
Waleed
2025-11-12 14:16:56 -08:00
committed by GitHub
parent 36bcd75832
commit ff081714e4

View File

@@ -3,7 +3,6 @@
import { useCallback, useState } from 'react'
import { Loader2 } from 'lucide-react'
import { Button, Rocket, Tooltip } from '@/components/emcn'
import { cn } from '@/lib/utils'
import { DeployModal } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/components'
import { useCurrentWorkflow } from '@/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-current-workflow'
import type { WorkspaceUserPermissions } from '@/hooks/use-user-permissions'
@@ -101,40 +100,25 @@ export function Deploy({ activeWorkflowId, userPermissions, className }: DeployP
return 'Deploy workflow'
}
const buttonContent = (
<>
{isDeploying ? (
<Loader2 className='h-[13px] w-[13px] animate-spin' />
) : (
<Rocket className='h-[13px] w-[13px]' />
)}
{changeDetected ? 'Update' : isDeployed ? 'Active' : 'Deploy'}
</>
)
return (
<>
<Tooltip.Root>
<Tooltip.Trigger asChild>
{isDisabled ? (
<div
className={cn(
'inline-flex h-[32px] items-center justify-center gap-[8px] px-[10px]',
'rounded-md border border-input bg-background font-medium text-sm opacity-50',
'shadow-sm transition-colors'
)}
>
{buttonContent}
</div>
) : (
<span>
<Button
className='h-[32px] gap-[8px] px-[10px]'
variant='active'
onClick={onDeployClick}
disabled={isDisabled}
>
{buttonContent}
{isDeploying ? (
<Loader2 className='h-[13px] w-[13px] animate-spin' />
) : (
<Rocket className='h-[13px] w-[13px]' />
)}
{changeDetected ? 'Update' : isDeployed ? 'Active' : 'Deploy'}
</Button>
)}
</span>
</Tooltip.Trigger>
<Tooltip.Content>{getTooltipText()}</Tooltip.Content>
</Tooltip.Root>