mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 10:28:10 +08:00
refactor(skill): replace React icon components with CSS Icons
Migrate all icon usage in the skill directory from @remixicon/react and custom SVG components to Tailwind CSS icon classes (i-ri-*, i-custom-*). Update MenuItem API to accept string class names instead of React.ElementType.
This commit is contained in:
@ -1,7 +1,6 @@
|
|||||||
import type { NodeRendererProps } from 'react-arborist'
|
import type { NodeRendererProps } from 'react-arborist'
|
||||||
import type { FileAppearanceType } from '@/app/components/base/file-uploader/types'
|
import type { FileAppearanceType } from '@/app/components/base/file-uploader/types'
|
||||||
import type { TreeNodeData } from '@/app/components/workflow/skill/type'
|
import type { TreeNodeData } from '@/app/components/workflow/skill/type'
|
||||||
import { RiArrowDownSLine, RiArrowRightSLine, RiFolderLine, RiFolderOpenLine, RiQuestionLine } from '@remixicon/react'
|
|
||||||
import { useSize } from 'ahooks'
|
import { useSize } from 'ahooks'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useMemo, useRef } from 'react'
|
import { useCallback, useMemo, useRef } from 'react'
|
||||||
@ -66,8 +65,8 @@ const FilePickerTreeNode = ({ node, style, dragHandle, onSelectNode }: FilePicke
|
|||||||
{isFolder
|
{isFolder
|
||||||
? (
|
? (
|
||||||
node.isOpen
|
node.isOpen
|
||||||
? <RiFolderOpenLine className="size-4 text-text-accent" aria-hidden="true" />
|
? <span className="i-ri-folder-open-line size-4 text-text-accent" aria-hidden="true" />
|
||||||
: <RiFolderLine className="size-4 text-text-secondary" aria-hidden="true" />
|
: <span className="i-ri-folder-line size-4 text-text-secondary" aria-hidden="true" />
|
||||||
)
|
)
|
||||||
: (
|
: (
|
||||||
<FileTypeIcon type={fileIconType as FileAppearanceType} size="sm" />
|
<FileTypeIcon type={fileIconType as FileAppearanceType} size="sm" />
|
||||||
@ -95,8 +94,8 @@ const FilePickerTreeNode = ({ node, style, dragHandle, onSelectNode }: FilePicke
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{node.isOpen
|
{node.isOpen
|
||||||
? <RiArrowDownSLine className="size-4" aria-hidden="true" />
|
? <span className="i-ri-arrow-down-s-line size-4" aria-hidden="true" />
|
||||||
: <RiArrowRightSLine className="size-4" aria-hidden="true" />}
|
: <span className="i-ri-arrow-right-s-line size-4" aria-hidden="true" />}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -162,7 +161,7 @@ const FilePickerPanel = ({
|
|||||||
<span className="flex-1 text-[12px] font-medium uppercase leading-4 text-text-tertiary">
|
<span className="flex-1 text-[12px] font-medium uppercase leading-4 text-text-tertiary">
|
||||||
{t('skillEditor.referenceFiles')}
|
{t('skillEditor.referenceFiles')}
|
||||||
</span>
|
</span>
|
||||||
<RiQuestionLine className="size-4 text-text-tertiary" aria-hidden="true" />
|
<span className="i-ri-question-line size-4 text-text-tertiary" aria-hidden="true" />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div
|
<div
|
||||||
|
|||||||
@ -2,7 +2,6 @@ import type { LexicalNode } from 'lexical'
|
|||||||
import type { FileAppearanceType } from '@/app/components/base/file-uploader/types'
|
import type { FileAppearanceType } from '@/app/components/base/file-uploader/types'
|
||||||
import type { TreeNodeData } from '@/app/components/workflow/skill/type'
|
import type { TreeNodeData } from '@/app/components/workflow/skill/type'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
||||||
import { RiFolderLine } from '@remixicon/react'
|
|
||||||
import { $getNodeByKey } from 'lexical'
|
import { $getNodeByKey } from 'lexical'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useMemo, useState } from 'react'
|
import { useCallback, useMemo, useState } from 'react'
|
||||||
@ -64,7 +63,7 @@ const FileReferenceBlock = ({ nodeKey, resourceId }: FileReferenceBlockProps) =>
|
|||||||
>
|
>
|
||||||
<span className="flex items-center justify-center p-px">
|
<span className="flex items-center justify-center p-px">
|
||||||
{isFolder
|
{isFolder
|
||||||
? <RiFolderLine className="size-[14px] text-text-accent" aria-hidden="true" />
|
? <span className="i-ri-folder-line size-[14px] text-text-accent" aria-hidden="true" />
|
||||||
: (
|
: (
|
||||||
<FileTypeIcon
|
<FileTypeIcon
|
||||||
type={(iconType || 'document') as FileAppearanceType}
|
type={(iconType || 'document') as FileAppearanceType}
|
||||||
|
|||||||
@ -2,13 +2,11 @@ import type { PluginDetail } from '@/app/components/plugins/types'
|
|||||||
import type { Emoji } from '@/app/components/tools/types'
|
import type { Emoji } from '@/app/components/tools/types'
|
||||||
import type { ToolValue } from '@/app/components/workflow/block-selector/types'
|
import type { ToolValue } from '@/app/components/workflow/block-selector/types'
|
||||||
import type { ToolWithProvider } from '@/app/components/workflow/types'
|
import type { ToolWithProvider } from '@/app/components/workflow/types'
|
||||||
import { RiAlertFill } from '@remixicon/react'
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useEffect, useMemo, useState } from 'react'
|
import { useEffect, useMemo, useState } from 'react'
|
||||||
import { createPortal } from 'react-dom'
|
import { createPortal } from 'react-dom'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import AppIcon from '@/app/components/base/app-icon'
|
import AppIcon from '@/app/components/base/app-icon'
|
||||||
import { InfoCircle } from '@/app/components/base/icons/src/vender/line/general'
|
|
||||||
import Modal from '@/app/components/base/modal'
|
import Modal from '@/app/components/base/modal'
|
||||||
import { useSelectOrDelete } from '@/app/components/base/prompt-editor/hooks'
|
import { useSelectOrDelete } from '@/app/components/base/prompt-editor/hooks'
|
||||||
import { FormTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'
|
import { FormTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'
|
||||||
@ -492,7 +490,7 @@ const ToolBlockComponent = ({
|
|||||||
{needAuthorization && (
|
{needAuthorization && (
|
||||||
<div className="flex min-h-[200px] flex-1 flex-col items-center justify-center px-4 py-6 text-text-tertiary">
|
<div className="flex min-h-[200px] flex-1 flex-col items-center justify-center px-4 py-6 text-text-tertiary">
|
||||||
<div className="flex h-9 w-9 items-center justify-center rounded-full border border-divider-subtle">
|
<div className="flex h-9 w-9 items-center justify-center rounded-full border border-divider-subtle">
|
||||||
<InfoCircle className="h-4 w-4 text-text-tertiary" />
|
<span className="i-custom-vender-line-general-info-circle h-4 w-4 text-text-tertiary" />
|
||||||
</div>
|
</div>
|
||||||
<div className="system-xs-regular mt-3 text-text-tertiary">
|
<div className="system-xs-regular mt-3 text-text-tertiary">
|
||||||
{t('skillEditor.authorizationRequired', { ns: 'workflow' })}
|
{t('skillEditor.authorizationRequired', { ns: 'workflow' })}
|
||||||
@ -536,7 +534,7 @@ const ToolBlockComponent = ({
|
|||||||
{needAuthorization && (
|
{needAuthorization && (
|
||||||
<span className="system-2xs-medium-uppercase flex h-4 items-center gap-0.5 rounded-[5px] border border-text-warning bg-components-badge-bg-dimm px-1 text-text-warning">
|
<span className="system-2xs-medium-uppercase flex h-4 items-center gap-0.5 rounded-[5px] border border-text-warning bg-components-badge-bg-dimm px-1 text-text-warning">
|
||||||
{authBadgeLabel}
|
{authBadgeLabel}
|
||||||
<RiAlertFill className="h-3 w-3" />
|
<span className="i-ri-alert-fill h-3 w-3" />
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@ -3,7 +3,6 @@ import type { PluginDetail } from '@/app/components/plugins/types'
|
|||||||
import type { ToolParameter } from '@/app/components/tools/types'
|
import type { ToolParameter } from '@/app/components/tools/types'
|
||||||
import type { ToolValue } from '@/app/components/workflow/block-selector/types'
|
import type { ToolValue } from '@/app/components/workflow/block-selector/types'
|
||||||
import type { ToolWithProvider } from '@/app/components/workflow/types'
|
import type { ToolWithProvider } from '@/app/components/workflow/types'
|
||||||
import { RiAlertFill, RiCloseLine, RiEqualizer2Line } from '@remixicon/react'
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useEffect, useMemo, useState } from 'react'
|
import { useCallback, useEffect, useMemo, useState } from 'react'
|
||||||
import { createPortal } from 'react-dom'
|
import { createPortal } from 'react-dom'
|
||||||
@ -650,7 +649,7 @@ const ToolGroupBlockComponent = ({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span className="sr-only">{t('operation.close', { ns: 'common' })}</span>
|
<span className="sr-only">{t('operation.close', { ns: 'common' })}</span>
|
||||||
<RiCloseLine className="h-4 w-4" />
|
<span className="i-ri-close-line h-4 w-4" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{providerDescription && (
|
{providerDescription && (
|
||||||
@ -741,7 +740,7 @@ const ToolGroupBlockComponent = ({
|
|||||||
setExpandedToolId(item.configId)
|
setExpandedToolId(item.configId)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<RiEqualizer2Line className="size-3.5" />
|
<span className="i-ri-equalizer-2-line size-3.5" />
|
||||||
<span className="system-xs-medium">{t('operation.settings', { ns: 'common' })}</span>
|
<span className="system-xs-medium">{t('operation.settings', { ns: 'common' })}</span>
|
||||||
</button>
|
</button>
|
||||||
<div className="mx-1 h-3 w-px bg-divider-regular "></div>
|
<div className="mx-1 h-3 w-px bg-divider-regular "></div>
|
||||||
@ -798,7 +797,7 @@ const ToolGroupBlockComponent = ({
|
|||||||
? (
|
? (
|
||||||
<span className="system-2xs-medium-uppercase flex h-4 items-center gap-0.5 rounded-[5px] border border-text-warning bg-components-badge-bg-dimm px-1 text-text-warning">
|
<span className="system-2xs-medium-uppercase flex h-4 items-center gap-0.5 rounded-[5px] border border-text-warning bg-components-badge-bg-dimm px-1 text-text-warning">
|
||||||
{authBadgeLabel}
|
{authBadgeLabel}
|
||||||
<RiAlertFill className="h-3 w-3" />
|
<span className="i-ri-alert-fill h-3 w-3" />
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
: (
|
: (
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { Emoji } from '@/app/components/tools/types'
|
import type { Emoji } from '@/app/components/tools/types'
|
||||||
import { RiArrowLeftSLine, RiCloseLine } from '@remixicon/react'
|
|
||||||
import AppIcon from '@/app/components/base/app-icon'
|
import AppIcon from '@/app/components/base/app-icon'
|
||||||
|
|
||||||
type ToolHeaderProps = {
|
type ToolHeaderProps = {
|
||||||
@ -71,7 +70,7 @@ const ToolHeader = ({
|
|||||||
onBack()
|
onBack()
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<RiArrowLeftSLine className="h-4 w-4" />
|
<span className="i-ri-arrow-left-s-line h-4 w-4" />
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
{renderHeaderIcon()}
|
{renderHeaderIcon()}
|
||||||
@ -89,7 +88,7 @@ const ToolHeader = ({
|
|||||||
onClose()
|
onClose()
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<RiCloseLine className="h-4 w-4" />
|
<span className="i-ri-close-line h-4 w-4" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { FileAppearanceType } from '@/app/components/base/file-uploader/types'
|
import type { FileAppearanceType } from '@/app/components/base/file-uploader/types'
|
||||||
import { RiCloseLine } from '@remixicon/react'
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback } from 'react'
|
import { useCallback } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
@ -95,7 +94,7 @@ const FileTabItem = ({
|
|||||||
aria-label={t('operation.close', { ns: 'common' })}
|
aria-label={t('operation.close', { ns: 'common' })}
|
||||||
onClick={handleClose}
|
onClick={handleClose}
|
||||||
>
|
>
|
||||||
<RiCloseLine className="size-4" aria-hidden="true" />
|
<span className="i-ri-close-line size-4" aria-hidden="true" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -1,11 +1,9 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { SandboxFileTreeNode } from '@/types/sandbox-file'
|
import type { SandboxFileTreeNode } from '@/types/sandbox-file'
|
||||||
import { RiArrowDownSLine, RiArrowRightSLine, RiLoader2Line } from '@remixicon/react'
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useState } from 'react'
|
import { useCallback, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import FolderSpark from '@/app/components/base/icons/src/vender/workflow/FolderSpark'
|
|
||||||
import { useStore, useWorkflowStore } from '@/app/components/workflow/store'
|
import { useStore, useWorkflowStore } from '@/app/components/workflow/store'
|
||||||
import { useAppContext } from '@/context/app-context'
|
import { useAppContext } from '@/context/app-context'
|
||||||
import { useDownloadSandboxFile, useSandboxFilesTree } from '@/service/use-sandbox-file'
|
import { useDownloadSandboxFile, useSandboxFilesTree } from '@/service/use-sandbox-file'
|
||||||
@ -67,7 +65,7 @@ const ArtifactsSection = ({ className }: ArtifactsSectionProps) => {
|
|||||||
>
|
>
|
||||||
<div className="flex flex-1 items-center gap-1 py-0.5">
|
<div className="flex flex-1 items-center gap-1 py-0.5">
|
||||||
<div className="flex size-5 items-center justify-center">
|
<div className="flex size-5 items-center justify-center">
|
||||||
<FolderSpark className="size-4 text-text-secondary" aria-hidden="true" />
|
<span className="i-custom-vender-workflow-folder-spark size-4 text-text-secondary" aria-hidden="true" />
|
||||||
</div>
|
</div>
|
||||||
<span className="system-sm-semibold uppercase text-text-secondary">
|
<span className="system-sm-semibold uppercase text-text-secondary">
|
||||||
{t('skillSidebar.artifacts.title')}
|
{t('skillSidebar.artifacts.title')}
|
||||||
@ -76,15 +74,15 @@ const ArtifactsSection = ({ className }: ArtifactsSectionProps) => {
|
|||||||
|
|
||||||
<div className="relative flex items-center">
|
<div className="relative flex items-center">
|
||||||
{showSpinner
|
{showSpinner
|
||||||
? <RiLoader2Line className="size-3.5 animate-spin text-text-tertiary" aria-hidden="true" />
|
? <span className="i-ri-loader-2-line size-3.5 animate-spin text-text-tertiary" aria-hidden="true" />
|
||||||
: (
|
: (
|
||||||
<>
|
<>
|
||||||
{showBlueDot && (
|
{showBlueDot && (
|
||||||
<div className="absolute -left-2 size-[7px] rounded-full border border-white bg-state-accent-solid" />
|
<div className="absolute -left-2 size-[7px] rounded-full border border-white bg-state-accent-solid" />
|
||||||
)}
|
)}
|
||||||
{isExpanded
|
{isExpanded
|
||||||
? <RiArrowDownSLine className="size-4 text-text-tertiary" aria-hidden="true" />
|
? <span className="i-ri-arrow-down-s-line size-4 text-text-tertiary" aria-hidden="true" />
|
||||||
: <RiArrowRightSLine className="size-4 text-text-tertiary" aria-hidden="true" />}
|
: <span className="i-ri-arrow-right-s-line size-4 text-text-tertiary" aria-hidden="true" />}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import type { FileAppearanceType } from '@/app/components/base/file-uploader/types'
|
import type { FileAppearanceType } from '@/app/components/base/file-uploader/types'
|
||||||
import type { SandboxFileTreeNode } from '@/types/sandbox-file'
|
import type { SandboxFileTreeNode } from '@/types/sandbox-file'
|
||||||
import { RiDownloadLine, RiFolderLine, RiFolderOpenLine } from '@remixicon/react'
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useState } from 'react'
|
import { useCallback, useState } from 'react'
|
||||||
import FileTypeIcon from '@/app/components/base/file-uploader/file-type-icon'
|
import FileTypeIcon from '@/app/components/base/file-uploader/file-type-icon'
|
||||||
@ -84,8 +83,8 @@ const ArtifactsTreeNode = ({
|
|||||||
{isFolder
|
{isFolder
|
||||||
? (
|
? (
|
||||||
isExpanded
|
isExpanded
|
||||||
? <RiFolderOpenLine className="size-4 text-text-accent" aria-hidden="true" />
|
? <span className="i-ri-folder-open-line size-4 text-text-accent" aria-hidden="true" />
|
||||||
: <RiFolderLine className="size-4 text-text-secondary" aria-hidden="true" />
|
: <span className="i-ri-folder-line size-4 text-text-secondary" aria-hidden="true" />
|
||||||
)
|
)
|
||||||
: <FileTypeIcon type={fileIconType as FileAppearanceType} size="sm" />}
|
: <FileTypeIcon type={fileIconType as FileAppearanceType} size="sm" />}
|
||||||
</div>
|
</div>
|
||||||
@ -107,7 +106,7 @@ const ArtifactsTreeNode = ({
|
|||||||
)}
|
)}
|
||||||
aria-label={`Download ${node.name}`}
|
aria-label={`Download ${node.name}`}
|
||||||
>
|
>
|
||||||
<RiDownloadLine className="size-3.5 text-text-tertiary" />
|
<span className="i-ri-download-line size-3.5 text-text-tertiary" />
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import type { MoveHandler, NodeApi, NodeRendererProps, TreeApi } from 'react-arb
|
|||||||
import type { TreeNodeData } from '../type'
|
import type { TreeNodeData } from '../type'
|
||||||
import type { OpensObject } from '@/app/components/workflow/store/workflow/skill-editor/file-tree-slice'
|
import type { OpensObject } from '@/app/components/workflow/store/workflow/skill-editor/file-tree-slice'
|
||||||
import type { AppAssetTreeView } from '@/types/app-asset'
|
import type { AppAssetTreeView } from '@/types/app-asset'
|
||||||
import { RiDragDropLine } from '@remixicon/react'
|
|
||||||
import { useIsMutating } from '@tanstack/react-query'
|
import { useIsMutating } from '@tanstack/react-query'
|
||||||
import { useSize } from 'ahooks'
|
import { useSize } from 'ahooks'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
@ -12,7 +11,6 @@ import { useCallback, useEffect, useMemo, useRef } from 'react'
|
|||||||
import { Tree } from 'react-arborist'
|
import { Tree } from 'react-arborist'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Button from '@/app/components/base/button'
|
import Button from '@/app/components/base/button'
|
||||||
import SearchMenu from '@/app/components/base/icons/src/vender/knowledge/SearchMenu'
|
|
||||||
import Loading from '@/app/components/base/loading'
|
import Loading from '@/app/components/base/loading'
|
||||||
import { useStore, useWorkflowStore } from '@/app/components/workflow/store'
|
import { useStore, useWorkflowStore } from '@/app/components/workflow/store'
|
||||||
import { cn } from '@/utils/classnames'
|
import { cn } from '@/utils/classnames'
|
||||||
@ -81,7 +79,7 @@ const DropTip = () => {
|
|||||||
const { t } = useTranslation('workflow')
|
const { t } = useTranslation('workflow')
|
||||||
return (
|
return (
|
||||||
<div className="flex shrink-0 items-center justify-center gap-2 py-4 text-text-quaternary">
|
<div className="flex shrink-0 items-center justify-center gap-2 py-4 text-text-quaternary">
|
||||||
<RiDragDropLine className="size-4" aria-hidden="true" />
|
<span className="i-ri-drag-drop-line size-4" aria-hidden="true" />
|
||||||
<span className="system-xs-regular">
|
<span className="system-xs-regular">
|
||||||
{t('skillSidebar.dropTip')}
|
{t('skillSidebar.dropTip')}
|
||||||
</span>
|
</span>
|
||||||
@ -348,7 +346,7 @@ const FileTree = ({ className }: FileTreeProps) => {
|
|||||||
return (
|
return (
|
||||||
<div className={cn('flex min-h-[150px] flex-1 flex-col overflow-y-auto', className)}>
|
<div className={cn('flex min-h-[150px] flex-1 flex-col overflow-y-auto', className)}>
|
||||||
<div className="flex flex-1 flex-col items-center justify-center gap-2 pb-20">
|
<div className="flex flex-1 flex-col items-center justify-center gap-2 pb-20">
|
||||||
<SearchMenu className="size-8 text-text-tertiary" aria-hidden="true" />
|
<span className="i-custom-vender-knowledge-search-menu size-8 text-text-tertiary" aria-hidden="true" />
|
||||||
<span className="system-xs-regular text-text-secondary">
|
<span className="system-xs-regular text-text-secondary">
|
||||||
{t('skillSidebar.searchNoResults')}
|
{t('skillSidebar.searchNoResults')}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@ -50,14 +50,14 @@ const labelVariants = cva('system-sm-regular text-text-secondary', {
|
|||||||
})
|
})
|
||||||
|
|
||||||
export type MenuItemProps = {
|
export type MenuItemProps = {
|
||||||
icon: React.ElementType
|
icon: string
|
||||||
label: string
|
label: string
|
||||||
kbd?: readonly string[]
|
kbd?: readonly string[]
|
||||||
onClick: React.MouseEventHandler<HTMLButtonElement>
|
onClick: React.MouseEventHandler<HTMLButtonElement>
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
} & VariantProps<typeof menuItemVariants>
|
} & VariantProps<typeof menuItemVariants>
|
||||||
|
|
||||||
const MenuItem = ({ icon: Icon, label, kbd, onClick, disabled, variant }: MenuItemProps) => {
|
const MenuItem = ({ icon, label, kbd, onClick, disabled, variant }: MenuItemProps) => {
|
||||||
const handleClick = React.useCallback((event: React.MouseEvent<HTMLButtonElement>) => {
|
const handleClick = React.useCallback((event: React.MouseEvent<HTMLButtonElement>) => {
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
onClick(event)
|
onClick(event)
|
||||||
@ -70,7 +70,7 @@ const MenuItem = ({ icon: Icon, label, kbd, onClick, disabled, variant }: MenuIt
|
|||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
className={cn(menuItemVariants({ variant }))}
|
className={cn(menuItemVariants({ variant }))}
|
||||||
>
|
>
|
||||||
<Icon className={cn(iconVariants({ variant }))} aria-hidden="true" />
|
<span className={cn(icon, iconVariants({ variant }))} aria-hidden="true" />
|
||||||
<span className={cn(labelVariants({ variant }), 'flex-1 text-left')}>{label}</span>
|
<span className={cn(labelVariants({ variant }), 'flex-1 text-left')}>{label}</span>
|
||||||
{kbd && kbd.length > 0 && <ShortcutsName keys={kbd} textColor="secondary" />}
|
{kbd && kbd.length > 0 && <ShortcutsName keys={kbd} textColor="secondary" />}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -3,21 +3,10 @@
|
|||||||
import type { NodeApi, TreeApi } from 'react-arborist'
|
import type { NodeApi, TreeApi } from 'react-arborist'
|
||||||
import type { NodeMenuType } from '../constants'
|
import type { NodeMenuType } from '../constants'
|
||||||
import type { TreeNodeData } from '../type'
|
import type { TreeNodeData } from '../type'
|
||||||
import {
|
|
||||||
RiClipboardLine,
|
|
||||||
RiDeleteBinLine,
|
|
||||||
RiEdit2Line,
|
|
||||||
RiFileAddLine,
|
|
||||||
RiFolderAddLine,
|
|
||||||
RiFolderUploadLine,
|
|
||||||
RiScissorsLine,
|
|
||||||
RiUploadLine,
|
|
||||||
} from '@remixicon/react'
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback } from 'react'
|
import { useCallback } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Confirm from '@/app/components/base/confirm'
|
import Confirm from '@/app/components/base/confirm'
|
||||||
import { Download02 } from '@/app/components/base/icons/src/vender/solid/general'
|
|
||||||
import { useStore, useWorkflowStore } from '@/app/components/workflow/store'
|
import { useStore, useWorkflowStore } from '@/app/components/workflow/store'
|
||||||
import { cn } from '@/utils/classnames'
|
import { cn } from '@/utils/classnames'
|
||||||
import { NODE_MENU_TYPE } from '../constants'
|
import { NODE_MENU_TYPE } from '../constants'
|
||||||
@ -119,13 +108,13 @@ const NodeMenu = ({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={RiFileAddLine}
|
icon="i-ri-file-add-line"
|
||||||
label={t('skillSidebar.menu.newFile')}
|
label={t('skillSidebar.menu.newFile')}
|
||||||
onClick={handleNewFile}
|
onClick={handleNewFile}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
/>
|
/>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={RiFolderAddLine}
|
icon="i-ri-folder-add-line"
|
||||||
label={t('skillSidebar.menu.newFolder')}
|
label={t('skillSidebar.menu.newFolder')}
|
||||||
onClick={handleNewFolder}
|
onClick={handleNewFolder}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
@ -134,13 +123,13 @@ const NodeMenu = ({
|
|||||||
<div className="my-1 h-px bg-divider-subtle" />
|
<div className="my-1 h-px bg-divider-subtle" />
|
||||||
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={RiUploadLine}
|
icon="i-ri-upload-line"
|
||||||
label={t('skillSidebar.menu.uploadFile')}
|
label={t('skillSidebar.menu.uploadFile')}
|
||||||
onClick={() => fileInputRef.current?.click()}
|
onClick={() => fileInputRef.current?.click()}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
/>
|
/>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={RiFolderUploadLine}
|
icon="i-ri-folder-upload-line"
|
||||||
label={t('skillSidebar.menu.uploadFolder')}
|
label={t('skillSidebar.menu.uploadFolder')}
|
||||||
onClick={() => folderInputRef.current?.click()}
|
onClick={() => folderInputRef.current?.click()}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
@ -153,7 +142,7 @@ const NodeMenu = ({
|
|||||||
{!isFolder && (
|
{!isFolder && (
|
||||||
<>
|
<>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={Download02}
|
icon="i-custom-vender-solid-general-download-02"
|
||||||
label={t('skillSidebar.menu.download')}
|
label={t('skillSidebar.menu.download')}
|
||||||
onClick={handleDownload}
|
onClick={handleDownload}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
@ -165,7 +154,7 @@ const NodeMenu = ({
|
|||||||
{!isRoot && (
|
{!isRoot && (
|
||||||
<>
|
<>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={RiScissorsLine}
|
icon="i-ri-scissors-line"
|
||||||
label={t('skillSidebar.menu.cut')}
|
label={t('skillSidebar.menu.cut')}
|
||||||
kbd={KBD_CUT}
|
kbd={KBD_CUT}
|
||||||
onClick={handleCut}
|
onClick={handleCut}
|
||||||
@ -176,7 +165,7 @@ const NodeMenu = ({
|
|||||||
|
|
||||||
{isFolder && hasClipboard && (
|
{isFolder && hasClipboard && (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={RiClipboardLine}
|
icon="i-ri-clipboard-line"
|
||||||
label={t('skillSidebar.menu.paste')}
|
label={t('skillSidebar.menu.paste')}
|
||||||
kbd={KBD_PASTE}
|
kbd={KBD_PASTE}
|
||||||
onClick={handlePaste}
|
onClick={handlePaste}
|
||||||
@ -188,13 +177,13 @@ const NodeMenu = ({
|
|||||||
<>
|
<>
|
||||||
<div className="my-1 h-px bg-divider-subtle" />
|
<div className="my-1 h-px bg-divider-subtle" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={RiEdit2Line}
|
icon="i-ri-edit-2-line"
|
||||||
label={t('skillSidebar.menu.rename')}
|
label={t('skillSidebar.menu.rename')}
|
||||||
onClick={handleRename}
|
onClick={handleRename}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
/>
|
/>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={RiDeleteBinLine}
|
icon="i-ri-delete-bin-line"
|
||||||
label={t('skillSidebar.menu.delete')}
|
label={t('skillSidebar.menu.delete')}
|
||||||
onClick={handleDeleteClick}
|
onClick={handleDeleteClick}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
// Icon rendering for tree nodes (folder/file icons with dirty indicator)
|
// Icon rendering for tree nodes (folder/file icons with dirty indicator)
|
||||||
|
|
||||||
import type { FileAppearanceType } from '@/app/components/base/file-uploader/types'
|
import type { FileAppearanceType } from '@/app/components/base/file-uploader/types'
|
||||||
import { RiFolderLine, RiFolderOpenLine } from '@remixicon/react'
|
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import FileTypeIcon from '@/app/components/base/file-uploader/file-type-icon'
|
import FileTypeIcon from '@/app/components/base/file-uploader/file-type-icon'
|
||||||
import { cn } from '@/utils/classnames'
|
import { cn } from '@/utils/classnames'
|
||||||
@ -41,8 +40,8 @@ export const TreeNodeIcon = ({
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{isOpen
|
{isOpen
|
||||||
? <RiFolderOpenLine className="size-4 text-text-accent" aria-hidden="true" />
|
? <span className="i-ri-folder-open-line size-4 text-text-accent" aria-hidden="true" />
|
||||||
: <RiFolderLine className="size-4 text-text-secondary" aria-hidden="true" />}
|
: <span className="i-ri-folder-line size-4 text-text-secondary" aria-hidden="true" />}
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import type { NodeRendererProps } from 'react-arborist'
|
import type { NodeRendererProps } from 'react-arborist'
|
||||||
import type { TreeNodeData } from '../type'
|
import type { TreeNodeData } from '../type'
|
||||||
import { RiMoreFill } from '@remixicon/react'
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
@ -171,7 +170,7 @@ const TreeNode = ({ node, style, dragHandle, treeChildren }: TreeNodeProps) => {
|
|||||||
)}
|
)}
|
||||||
aria-label={t('skillSidebar.menu.moreActions')}
|
aria-label={t('skillSidebar.menu.moreActions')}
|
||||||
>
|
>
|
||||||
<RiMoreFill className="size-4 text-text-tertiary" aria-hidden="true" />
|
<span className="i-ri-more-fill size-4 text-text-tertiary" aria-hidden="true" />
|
||||||
</button>
|
</button>
|
||||||
</PortalToFollowElemTrigger>
|
</PortalToFollowElemTrigger>
|
||||||
<PortalToFollowElemContent className="z-[100]">
|
<PortalToFollowElemContent className="z-[100]">
|
||||||
|
|||||||
@ -1,12 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { ReactNode } from 'react'
|
import type { ReactNode } from 'react'
|
||||||
import {
|
|
||||||
RiAlertFill,
|
|
||||||
RiCheckboxCircleFill,
|
|
||||||
RiCloseLine,
|
|
||||||
RiUploadCloud2Line,
|
|
||||||
} from '@remixicon/react'
|
|
||||||
import { memo, useEffect, useRef } from 'react'
|
import { memo, useEffect, useRef } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { useStore, useWorkflowStore } from '@/app/components/workflow/store'
|
import { useStore, useWorkflowStore } from '@/app/components/workflow/store'
|
||||||
@ -74,13 +68,13 @@ const UploadStatusTooltip = ({ fallback }: UploadStatusTooltipProps) => {
|
|||||||
|
|
||||||
<div className="relative z-10 shrink-0">
|
<div className="relative z-10 shrink-0">
|
||||||
{uploadStatus === 'uploading' && (
|
{uploadStatus === 'uploading' && (
|
||||||
<RiUploadCloud2Line className="size-6 text-text-accent" />
|
<span className="i-ri-upload-cloud-2-line size-6 text-text-accent" />
|
||||||
)}
|
)}
|
||||||
{uploadStatus === 'success' && (
|
{uploadStatus === 'success' && (
|
||||||
<RiCheckboxCircleFill className="size-5 text-text-success" />
|
<span className="i-ri-checkbox-circle-fill size-5 text-text-success" />
|
||||||
)}
|
)}
|
||||||
{uploadStatus === 'partial_error' && (
|
{uploadStatus === 'partial_error' && (
|
||||||
<RiAlertFill className="size-5 text-text-warning" />
|
<span className="i-ri-alert-fill size-5 text-text-warning" />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -118,7 +112,7 @@ const UploadStatusTooltip = ({ fallback }: UploadStatusTooltipProps) => {
|
|||||||
className="relative z-10 shrink-0 rounded p-0.5 text-text-tertiary hover:text-text-secondary focus-visible:outline focus-visible:outline-2 focus-visible:outline-state-accent-solid"
|
className="relative z-10 shrink-0 rounded p-0.5 text-text-tertiary hover:text-text-secondary focus-visible:outline focus-visible:outline-2 focus-visible:outline-state-accent-solid"
|
||||||
onClick={handleClose}
|
onClick={handleClose}
|
||||||
>
|
>
|
||||||
<RiCloseLine className="size-4" />
|
<span className="i-ri-close-line size-4" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,12 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import {
|
|
||||||
RiAddLine,
|
|
||||||
RiFileAddLine,
|
|
||||||
RiFolderAddLine,
|
|
||||||
RiFolderUploadLine,
|
|
||||||
RiUploadLine,
|
|
||||||
} from '@remixicon/react'
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useMemo, useState } from 'react'
|
import { useMemo, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
@ -25,13 +18,13 @@ import { useSkillAssetTreeData } from './hooks/use-skill-asset-tree'
|
|||||||
import { getTargetFolderIdFromSelection } from './utils/tree-utils'
|
import { getTargetFolderIdFromSelection } from './utils/tree-utils'
|
||||||
|
|
||||||
type MenuItemProps = {
|
type MenuItemProps = {
|
||||||
icon: React.ElementType
|
icon: string
|
||||||
label: string
|
label: string
|
||||||
onClick: () => void
|
onClick: () => void
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const MenuItem = ({ icon: Icon, label, onClick, disabled }: MenuItemProps) => (
|
const MenuItem = ({ icon, label, onClick, disabled }: MenuItemProps) => (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
@ -42,7 +35,7 @@ const MenuItem = ({ icon: Icon, label, onClick, disabled }: MenuItemProps) => (
|
|||||||
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-components-input-border-active',
|
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-components-input-border-active',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Icon className="size-4 text-text-tertiary" aria-hidden="true" />
|
<span className={cn(icon, 'size-4 text-text-tertiary')} aria-hidden="true" />
|
||||||
<span className="system-sm-regular text-text-secondary">
|
<span className="system-sm-regular text-text-secondary">
|
||||||
{label}
|
{label}
|
||||||
</span>
|
</span>
|
||||||
@ -100,7 +93,7 @@ const SidebarSearchAdd = () => {
|
|||||||
className="!size-6 shrink-0 !p-1"
|
className="!size-6 shrink-0 !p-1"
|
||||||
aria-label={t('operation.add', { ns: 'common' })}
|
aria-label={t('operation.add', { ns: 'common' })}
|
||||||
>
|
>
|
||||||
<RiAddLine className="size-4" aria-hidden="true" />
|
<span className="i-ri-add-line size-4" aria-hidden="true" />
|
||||||
</Button>
|
</Button>
|
||||||
</PortalToFollowElemTrigger>
|
</PortalToFollowElemTrigger>
|
||||||
<PortalToFollowElemContent className="z-[30]">
|
<PortalToFollowElemContent className="z-[30]">
|
||||||
@ -122,13 +115,13 @@ const SidebarSearchAdd = () => {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={RiFileAddLine}
|
icon="i-ri-file-add-line"
|
||||||
label={t('skillSidebar.menu.newFile')}
|
label={t('skillSidebar.menu.newFile')}
|
||||||
onClick={handleNewFile}
|
onClick={handleNewFile}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
/>
|
/>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={RiFolderAddLine}
|
icon="i-ri-folder-add-line"
|
||||||
label={t('skillSidebar.menu.newFolder')}
|
label={t('skillSidebar.menu.newFolder')}
|
||||||
onClick={handleNewFolder}
|
onClick={handleNewFolder}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
@ -137,13 +130,13 @@ const SidebarSearchAdd = () => {
|
|||||||
<div className="my-1 h-px bg-divider-subtle" />
|
<div className="my-1 h-px bg-divider-subtle" />
|
||||||
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={RiUploadLine}
|
icon="i-ri-upload-line"
|
||||||
label={t('skillSidebar.menu.uploadFile')}
|
label={t('skillSidebar.menu.uploadFile')}
|
||||||
onClick={() => fileInputRef.current?.click()}
|
onClick={() => fileInputRef.current?.click()}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
/>
|
/>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={RiFolderUploadLine}
|
icon="i-ri-folder-upload-line"
|
||||||
label={t('skillSidebar.menu.uploadFolder')}
|
label={t('skillSidebar.menu.uploadFolder')}
|
||||||
onClick={() => folderInputRef.current?.click()}
|
onClick={() => folderInputRef.current?.click()}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Home from '@/app/components/base/icons/src/vender/workflow/Home'
|
|
||||||
import { cn } from '@/utils/classnames'
|
import { cn } from '@/utils/classnames'
|
||||||
|
|
||||||
type StartTabItemProps = {
|
type StartTabItemProps = {
|
||||||
@ -32,8 +31,8 @@ const StartTabItem = ({
|
|||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
>
|
>
|
||||||
<div className="flex size-5 shrink-0 items-center justify-center">
|
<div className="flex size-5 shrink-0 items-center justify-center">
|
||||||
<Home className={cn(
|
<span className={cn(
|
||||||
'size-4',
|
'i-custom-vender-workflow-home size-4',
|
||||||
isActive ? 'text-text-secondary' : 'text-text-tertiary',
|
isActive ? 'text-text-secondary' : 'text-text-tertiary',
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { RiAddCircleFill, RiUploadLine } from '@remixicon/react'
|
|
||||||
import { memo } from 'react'
|
import { memo } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import ActionCard from './action-card'
|
import ActionCard from './action-card'
|
||||||
@ -11,12 +10,12 @@ const CreateImportSection = () => {
|
|||||||
return (
|
return (
|
||||||
<div className="grid grid-cols-3 gap-2 px-6 pb-4 pt-6">
|
<div className="grid grid-cols-3 gap-2 px-6 pb-4 pt-6">
|
||||||
<ActionCard
|
<ActionCard
|
||||||
icon={<RiAddCircleFill className="size-5 text-text-accent" />}
|
icon={<span className="i-ri-add-circle-fill size-5 text-text-accent" />}
|
||||||
title={t('skill.startTab.createBlankSkill')}
|
title={t('skill.startTab.createBlankSkill')}
|
||||||
description={t('skill.startTab.createBlankSkillDesc')}
|
description={t('skill.startTab.createBlankSkillDesc')}
|
||||||
/>
|
/>
|
||||||
<ActionCard
|
<ActionCard
|
||||||
icon={<RiUploadLine className="size-5 text-text-accent" />}
|
icon={<span className="i-ri-upload-line size-5 text-text-accent" />}
|
||||||
title={t('skill.startTab.importSkill')}
|
title={t('skill.startTab.importSkill')}
|
||||||
description={t('skill.startTab.importSkillDesc')}
|
description={t('skill.startTab.importSkillDesc')}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { RiSearchLine } from '@remixicon/react'
|
|
||||||
import { memo } from 'react'
|
import { memo } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
@ -17,7 +16,7 @@ const TemplateSearch = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex shrink-0 items-center gap-0.5 rounded-md bg-components-input-bg-normal p-2">
|
<div className="flex shrink-0 items-center gap-0.5 rounded-md bg-components-input-bg-normal p-2">
|
||||||
<RiSearchLine className="size-4 shrink-0 text-text-placeholder" aria-hidden="true" />
|
<span className="i-ri-search-line size-4 shrink-0 text-text-placeholder" aria-hidden="true" />
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
name="template-search"
|
name="template-search"
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
import { RiArrowDownSLine } from '@remixicon/react'
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useMemo, useState } from 'react'
|
import { useMemo, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { Check } from '@/app/components/base/icons/src/vender/line/general'
|
|
||||||
import { TableCells } from '@/app/components/base/icons/src/vender/solid/development'
|
|
||||||
import {
|
import {
|
||||||
PortalToFollowElem,
|
PortalToFollowElem,
|
||||||
PortalToFollowElemContent,
|
PortalToFollowElemContent,
|
||||||
@ -40,7 +37,7 @@ const TableSelector = ({
|
|||||||
if (isSingleTable) {
|
if (isSingleTable) {
|
||||||
return (
|
return (
|
||||||
<div className="inline-flex items-center gap-1 rounded-[6px] px-1.5 py-1 text-text-secondary">
|
<div className="inline-flex items-center gap-1 rounded-[6px] px-1.5 py-1 text-text-secondary">
|
||||||
<TableCells className="h-3.5 w-3.5 text-text-secondary" aria-hidden="true" />
|
<span className="i-custom-vender-solid-development-table-cells h-3.5 w-3.5 text-text-secondary" aria-hidden="true" />
|
||||||
<span className={cn('system-sm-medium min-w-0 max-w-[220px] truncate', isPlaceholder && 'text-text-tertiary')}>
|
<span className={cn('system-sm-medium min-w-0 max-w-[220px] truncate', isPlaceholder && 'text-text-tertiary')}>
|
||||||
{label}
|
{label}
|
||||||
</span>
|
</span>
|
||||||
@ -70,11 +67,11 @@ const TableSelector = ({
|
|||||||
isLoading ? 'cursor-not-allowed opacity-60' : 'cursor-pointer hover:bg-state-base-hover',
|
isLoading ? 'cursor-not-allowed opacity-60' : 'cursor-pointer hover:bg-state-base-hover',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<TableCells className="h-3.5 w-3.5 text-text-secondary" aria-hidden="true" />
|
<span className="i-custom-vender-solid-development-table-cells h-3.5 w-3.5 text-text-secondary" aria-hidden="true" />
|
||||||
<span className={cn('system-sm-medium min-w-0 max-w-[220px] truncate', isPlaceholder && 'text-text-tertiary')}>
|
<span className={cn('system-sm-medium min-w-0 max-w-[220px] truncate', isPlaceholder && 'text-text-tertiary')}>
|
||||||
{label}
|
{label}
|
||||||
</span>
|
</span>
|
||||||
<RiArrowDownSLine className="h-3.5 w-3.5 text-text-secondary" aria-hidden="true" />
|
<span className="i-ri-arrow-down-s-line h-3.5 w-3.5 text-text-secondary" aria-hidden="true" />
|
||||||
</button>
|
</button>
|
||||||
</PortalToFollowElemTrigger>
|
</PortalToFollowElemTrigger>
|
||||||
<PortalToFollowElemContent className="z-20">
|
<PortalToFollowElemContent className="z-20">
|
||||||
@ -93,10 +90,10 @@ const TableSelector = ({
|
|||||||
setOpen(false)
|
setOpen(false)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<TableCells className="h-4 w-4 shrink-0 text-text-secondary" aria-hidden="true" />
|
<span className="i-custom-vender-solid-development-table-cells h-4 w-4 shrink-0 text-text-secondary" aria-hidden="true" />
|
||||||
<span className="flex-1 truncate px-1">{item.name}</span>
|
<span className="flex-1 truncate px-1">{item.name}</span>
|
||||||
{item.value === selectedTable && (
|
{item.value === selectedTable && (
|
||||||
<Check className="h-4 w-4 shrink-0 text-text-accent" aria-hidden="true" />
|
<span className="i-custom-vender-line-general-check h-4 w-4 shrink-0 text-text-accent" aria-hidden="true" />
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
|
|||||||
Reference in New Issue
Block a user