'use client' import React from 'react' import { useTranslation } from 'react-i18next' import Modal from '@/app/components/base/modal' import Button from '@/app/components/base/button' import Toast from '@/app/components/base/toast' import cn from 'classnames' import s from './style.module.css' type IProps = { appName: string, show: boolean, onConfirm: (info: any) => void, onHide: () => void, } const CreateAppModal = ({ appName, show = false, onConfirm, onHide, }: IProps) => { const { t } = useTranslation() const [name, setName] = React.useState('') const submit = () => { if(!name.trim()) { Toast.notify({ type: 'error', message: t('explore.appCustomize.nameRequired') }) return } onConfirm({ name, }) onHide() } return (
{t('explore.appCustomize.title', {name: appName})}
{t('explore.appCustomize.subTitle')}
setName(e.target.value)} className='h-10 px-3 text-sm font-normal bg-gray-100 rounded-lg grow' />
) } export default CreateAppModal