You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gcgj-dify-1.7.0/web/app/components/app/create-app-dialog/index.tsx

37 lines
854 B
TypeScript

'use client'
import { useCallback } from 'react'
import { useKeyPress } from 'ahooks'
import AppList from './app-list'
import FullScreenModal from '@/app/components/base/fullscreen-modal'
type CreateAppDialogProps = {
show: boolean
onSuccess: () => void
onClose: () => void
onCreateFromBlank?: () => void
}
const CreateAppTemplateDialog = ({ show, onSuccess, onClose, onCreateFromBlank }: CreateAppDialogProps) => {
const handleEscKeyPress = useCallback(() => {
if (show)
onClose()
}, [show, onClose])
useKeyPress('esc', handleEscKeyPress)
return (
<FullScreenModal
open={show}
closable
onClose={onClose}
>
<AppList onCreateFromBlank={onCreateFromBlank} onSuccess={() => {
onSuccess()
onClose()
}} />
</FullScreenModal>
)
}
export default CreateAppTemplateDialog