| 10 | } |
| 11 | |
| 12 | const ActionConfirmModal = (props: ActionConfirmModalProps) => { |
| 13 | const { close, confirm, title, content, confirmButtonStyle } = props; |
| 14 | const { t } = useTranslation(); |
| 15 | |
| 16 | return ( |
| 17 | <Modal title={title} onClose={close}> |
| 18 | <div className="w-full flex flex-col justify-start items-start mt-2"> |
| 19 | <p className="text-gray-500">{content}</p> |
| 20 | </div> |
| 21 | <div className="w-full flex flex-row justify-end items-center mt-4 space-x-2"> |
| 22 | <button className="btn btn-outline" onClick={close}> |
| 23 | {t("common.close")} |
| 24 | </button> |
| 25 | <button |
| 26 | className={`btn ${confirmButtonStyle}`} |
| 27 | onClick={() => { |
| 28 | confirm(); |
| 29 | close(); |
| 30 | }} |
| 31 | > |
| 32 | {t("common.confirm")} |
| 33 | </button> |
| 34 | </div> |
| 35 | </Modal> |
| 36 | ); |
| 37 | }; |
| 38 | |
| 39 | export default ActionConfirmModal; |