mirror of
https://github.com/langgenius/dify.git
synced 2026-06-19 00:21:10 +08:00
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: yyh <yuanyouhuilyz@gmail.com> Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: hjlarry <hjlarry@163.com> Co-authored-by: fatelei <fatelei@gmail.com> Co-authored-by: Asuka Minato <i@asukaminato.eu.org> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Xiyuan Chen <52963600+GareArc@users.noreply.github.com> Co-authored-by: gigglewang <gigglewang@dify.ai> Co-authored-by: Yunlu Wen <yunlu.wen@dify.ai> Co-authored-by: chariri <w@chariri.moe> Co-authored-by: Evan <2869018789@qq.com> Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
91 lines
2.5 KiB
TypeScript
91 lines
2.5 KiB
TypeScript
'use client'
|
|
|
|
import type { AppListCategory } from './app-type-filter-shared'
|
|
import dynamic from '@/next/dynamic'
|
|
|
|
const CreateFromDSLModal = dynamic(() => import('@/app/components/app/create-from-dsl-modal'), {
|
|
ssr: false,
|
|
})
|
|
const CreateAppModal = dynamic(() => import('@/app/components/app/create-app-modal'), {
|
|
ssr: false,
|
|
})
|
|
const CreateAppTemplateDialog = dynamic(() => import('@/app/components/app/create-app-dialog'), {
|
|
ssr: false,
|
|
})
|
|
|
|
export function AppListCreationModals({
|
|
category,
|
|
droppedDSLFile,
|
|
showCreateFromDSLModal,
|
|
showNewAppModal,
|
|
showNewAppTemplateDialog,
|
|
onPlanInfoChanged,
|
|
onRefetch,
|
|
onSetDroppedDSLFile,
|
|
onSetShowCreateFromDSLModal,
|
|
onSetShowNewAppModal,
|
|
onSetShowNewAppTemplateDialog,
|
|
}: {
|
|
category: AppListCategory
|
|
droppedDSLFile?: File
|
|
showCreateFromDSLModal: boolean
|
|
showNewAppModal: boolean
|
|
showNewAppTemplateDialog: boolean
|
|
onPlanInfoChanged: () => void
|
|
onRefetch: () => void
|
|
onSetDroppedDSLFile: (file?: File) => void
|
|
onSetShowCreateFromDSLModal: (show: boolean) => void
|
|
onSetShowNewAppModal: (show: boolean) => void
|
|
onSetShowNewAppTemplateDialog: (show: boolean) => void
|
|
}) {
|
|
return (
|
|
<>
|
|
{showCreateFromDSLModal && (
|
|
<CreateFromDSLModal
|
|
show={showCreateFromDSLModal}
|
|
onClose={() => {
|
|
onSetShowCreateFromDSLModal(false)
|
|
onSetDroppedDSLFile(undefined)
|
|
}}
|
|
onSuccess={() => {
|
|
onSetShowCreateFromDSLModal(false)
|
|
onSetDroppedDSLFile(undefined)
|
|
onPlanInfoChanged()
|
|
onRefetch()
|
|
}}
|
|
droppedFile={droppedDSLFile}
|
|
/>
|
|
)}
|
|
{showNewAppModal && (
|
|
<CreateAppModal
|
|
show={showNewAppModal}
|
|
onClose={() => onSetShowNewAppModal(false)}
|
|
onSuccess={() => {
|
|
onPlanInfoChanged()
|
|
onRefetch()
|
|
}}
|
|
onCreateFromTemplate={() => {
|
|
onSetShowNewAppTemplateDialog(true)
|
|
onSetShowNewAppModal(false)
|
|
}}
|
|
defaultAppMode={category !== 'all' ? category : undefined}
|
|
/>
|
|
)}
|
|
{showNewAppTemplateDialog && (
|
|
<CreateAppTemplateDialog
|
|
show={showNewAppTemplateDialog}
|
|
onClose={() => onSetShowNewAppTemplateDialog(false)}
|
|
onSuccess={() => {
|
|
onPlanInfoChanged()
|
|
onRefetch()
|
|
}}
|
|
onCreateFromBlank={() => {
|
|
onSetShowNewAppModal(true)
|
|
onSetShowNewAppTemplateDialog(false)
|
|
}}
|
|
/>
|
|
)}
|
|
</>
|
|
)
|
|
}
|