mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
fix(deploy): fix button (#1949)
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user