mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-05-14 04:28:17 +08:00

Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: Patryk Garstecki <patryk20120@yahoo.pl> Co-authored-by: Sebastian.W <thiner@gmail.com> Co-authored-by: 呆萌闷油瓶 <253605712@qq.com> Co-authored-by: takatost <takatost@users.noreply.github.com> Co-authored-by: rechardwang <wh_goodjob@163.com> Co-authored-by: Nite Knite <nkCoding@gmail.com> Co-authored-by: Chenhe Gu <guchenhe@gmail.com> Co-authored-by: Joshua <138381132+joshua20231026@users.noreply.github.com> Co-authored-by: Weaxs <459312872@qq.com> Co-authored-by: Ikko Eltociear Ashimine <eltociear@gmail.com> Co-authored-by: leejoo0 <81673835+leejoo0@users.noreply.github.com> Co-authored-by: JzoNg <jzongcode@gmail.com> Co-authored-by: sino <sino2322@gmail.com> Co-authored-by: Vikey Chen <vikeytk@gmail.com> Co-authored-by: wanghl <Wang-HL@users.noreply.github.com> Co-authored-by: Haolin Wang-汪皓临 <haolin.wang@atlaslovestravel.com> Co-authored-by: Zixuan Cheng <61724187+Theysua@users.noreply.github.com> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> Co-authored-by: Bowen Liang <bowenliang@apache.org> Co-authored-by: Bowen Liang <liangbowen@gf.com.cn> Co-authored-by: fanghongtai <42790567+fanghongtai@users.noreply.github.com> Co-authored-by: wxfanghongtai <wxfanghongtai@gf.com.cn> Co-authored-by: Matri <qjp@bithuman.io> Co-authored-by: Benjamin <benjaminx@gmail.com>
48 lines
1.8 KiB
TypeScript
48 lines
1.8 KiB
TypeScript
'use client'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
|
import cn from 'classnames'
|
|
import s from './style.module.css'
|
|
import Button from '@/app/components/base/button'
|
|
import Modal from '@/app/components/base/modal'
|
|
import { XClose } from '@/app/components/base/icons/src/vender/line/general'
|
|
import { AlertTriangle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback'
|
|
|
|
type ConfirmModalProps = {
|
|
show: boolean
|
|
onConfirm?: () => void
|
|
onClose: () => void
|
|
}
|
|
|
|
const ConfirmModal = ({ show, onConfirm, onClose }: ConfirmModalProps) => {
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
<Modal
|
|
wrapperClassName='!z-[1020]'
|
|
className={cn('p-8 max-w-[600px] w-[600px]', s.bg)}
|
|
isShow={show}
|
|
onClose={() => {}}
|
|
>
|
|
<div className='absolute right-4 top-4 p-2 cursor-pointer' onClick={onClose}>
|
|
<XClose className='w-4 h-4 text-gray-500' />
|
|
</div>
|
|
<div className='w-12 h-12 p-3 bg-white rounded-xl border-[0.5px] border-gray-100 shadow-xl'>
|
|
<AlertTriangle className='w-6 h-6 text-[rgb(247,144,9)]' />
|
|
</div>
|
|
<div className='relative mt-3 text-xl font-semibold leading-[30px] text-gray-900'>{t('tools.createTool.confirmTitle')}</div>
|
|
<div className='my-1 text-gray-500 text-sm leading-5'>
|
|
{t('tools.createTool.confirmTip')}
|
|
</div>
|
|
<div className='pt-6 flex justify-end items-center'>
|
|
<div className='flex items-center'>
|
|
<Button className='mr-2 text-gray-700 text-sm font-medium' onClick={onClose}>{t('common.operation.cancel')}</Button>
|
|
<Button className='text-sm font-medium border-red-700 border-[0.5px]' type="warning" onClick={onConfirm}>{t('common.operation.confirm')}</Button>
|
|
</div>
|
|
</div>
|
|
</Modal>
|
|
)
|
|
}
|
|
|
|
export default ConfirmModal
|