import type { FC, ReactElement } from 'react' import { useTranslation } from 'react-i18next' import cn from 'classnames' import s from './common.module.css' import Modal from '@/app/components/base/modal' import { XClose } from '@/app/components/base/icons/src/vender/line/general' import { AlertCircle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback' import { CheckCircle } from '@/app/components/base/icons/src/vender/solid/general' import Button from '@/app/components/base/button' export type ConfirmCommonProps = { type?: string isShow: boolean onCancel: () => void title: string desc?: string onConfirm?: () => void showOperate?: boolean showOperateCancel?: boolean confirmBtnClassName?: string confirmText?: string confirmWrapperClassName?: string confirmDisabled?: boolean } const ConfirmCommon: FC = ({ type = 'danger', isShow, onCancel, title, desc, onConfirm, showOperate = true, showOperateCancel = true, confirmBtnClassName, confirmText, confirmWrapperClassName, confirmDisabled, }) => { const { t } = useTranslation() const CONFIRM_MAP: Record = { danger: { icon: , confirmText: t('common.operation.remove'), }, success: { icon: , confirmText: t('common.operation.ok'), }, } return ( {}} className='!w-[480px] !max-w-[480px] !p-0 !rounded-2xl' wrapperClassName={confirmWrapperClassName}>
{CONFIRM_MAP[type].icon}
{title}
{ desc &&
{desc}
} { showOperate && (
{ showOperateCancel && ( ) }
) }
) } export default ConfirmCommon