mirror of
https://github.com/langgenius/dify.git
synced 2026-03-27 09:09:54 +08:00
Frontend: - Migrate deprecated imports: modal→dialog, toast→ui/toast, tooltip→tooltip-plus, portal-to-follow-elem→portal-to-follow-elem-plus, select→ui/select, confirm→alert-dialog - Replace next/* with @/next/* wrapper modules - Convert TypeScript enums to const objects (erasable-syntax-only) - Replace all `any` types with `unknown` or specific types in workflow types - Fix unused vars, react-hooks-extra, react-refresh/only-export-components - Extract InteractionMode to separate module, tool-block commands to commands.ts Backend: - Fix pyrefly errors: type narrowing, null guards, getattr patterns - Remove unused TYPE_CHECKING imports in LLM node - Add ignore_imports entries to .importlinter for dify_graph boundary violations Made-with: Cursor
47 lines
1.5 KiB
TypeScript
47 lines
1.5 KiB
TypeScript
'use client'
|
|
|
|
import { memo, useState } from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import dynamic from '@/next/dynamic'
|
|
import ActionCard from './action-card'
|
|
import CreateBlankSkillModal from './create-blank-skill-modal'
|
|
|
|
const ImportSkillModal = dynamic(() => import('./import-skill-modal'), {
|
|
ssr: false,
|
|
})
|
|
|
|
const CreateImportSection = () => {
|
|
const { t } = useTranslation('workflow')
|
|
const [isCreateModalOpen, setIsCreateModalOpen] = useState(false)
|
|
const [isImportModalOpen, setIsImportModalOpen] = useState(false)
|
|
|
|
return (
|
|
<>
|
|
<div className="grid grid-cols-3 gap-2 px-6 pb-4 pt-6">
|
|
<ActionCard
|
|
icon={<span className="i-ri-add-circle-fill size-5 text-text-accent" />}
|
|
title={t('skill.startTab.createBlankSkill')}
|
|
description={t('skill.startTab.createBlankSkillDesc')}
|
|
onClick={() => setIsCreateModalOpen(true)}
|
|
/>
|
|
<ActionCard
|
|
icon={<span className="i-ri-upload-line size-5 text-text-accent" />}
|
|
title={t('skill.startTab.importSkill')}
|
|
description={t('skill.startTab.importSkillDesc')}
|
|
onClick={() => setIsImportModalOpen(true)}
|
|
/>
|
|
</div>
|
|
<CreateBlankSkillModal
|
|
isOpen={isCreateModalOpen}
|
|
onClose={() => setIsCreateModalOpen(false)}
|
|
/>
|
|
<ImportSkillModal
|
|
isOpen={isImportModalOpen}
|
|
onClose={() => setIsImportModalOpen(false)}
|
|
/>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default memo(CreateImportSection)
|