chore: open in editor tooltip

This commit is contained in:
Joel
2026-02-05 16:10:50 +08:00
parent 733c8a0d76
commit befefb04b4
3 changed files with 18 additions and 10 deletions

View File

@ -7,6 +7,7 @@ import { useTranslation } from 'react-i18next'
import { useStore as useAppStore } from '@/app/components/app/store'
import FileTypeIcon from '@/app/components/base/file-uploader/file-type-icon'
import Loading from '@/app/components/base/loading'
import Tooltip from '@/app/components/base/tooltip'
import SkillEditor from '@/app/components/workflow/skill/editor/skill-editor'
import { useFileTypeInfo } from '@/app/components/workflow/skill/hooks/use-file-type-info'
import { getFileIconType } from '@/app/components/workflow/skill/utils/file-utils'
@ -101,18 +102,23 @@ const FilePreviewPanel = ({ resourceId, currentNode, className, style, onClose }
</div>
)}
</div>
<button
type="button"
onClick={handleOpenInEditor}
<Tooltip
popupContent={t('skillEditor.openInSkillEditor', { ns: 'workflow' })}
disabled={!canOpenInEditor}
className={cn(
'inline-flex size-6 items-center justify-center rounded-md text-text-tertiary transition hover:bg-state-base-hover',
!canOpenInEditor && 'cursor-not-allowed opacity-40 hover:bg-transparent',
)}
aria-label={t('nodes.note.editor.openLink')}
>
<RiExternalLinkLine className="size-4" />
</button>
<button
type="button"
onClick={handleOpenInEditor}
disabled={!canOpenInEditor}
className={cn(
'inline-flex size-6 items-center justify-center rounded-md text-text-tertiary transition hover:bg-state-base-hover',
!canOpenInEditor && 'cursor-not-allowed opacity-40 hover:bg-transparent',
)}
aria-label={t('skillEditor.openInSkillEditor', { ns: 'workflow' })}
>
<RiExternalLinkLine className="size-4" />
</button>
</Tooltip>
<button
type="button"
onClick={onClose}