mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-09-26 01:23:18 +08:00
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import { useTranslation } from "react-i18next";
|
|
import Modal from "./kit/Modal";
|
|
|
|
export interface ActionConfirmModalProps {
|
|
title: string;
|
|
content: string;
|
|
confirmButtonStyle: string;
|
|
open: boolean;
|
|
close: () => void;
|
|
confirm: () => void;
|
|
}
|
|
|
|
const ActionConfirmModal = (props: ActionConfirmModalProps) => {
|
|
const { close, confirm, title, content, open, confirmButtonStyle } = props;
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<Modal title={title} open={open} onClose={close}>
|
|
<div className="w-full flex flex-col justify-start items-start mt-2">
|
|
<p className="text-gray-500">{content}</p>
|
|
</div>
|
|
<div className="w-full flex flex-row justify-end items-center mt-4 space-x-2">
|
|
<button className="btn btn-outline" onClick={close}>
|
|
{t("common.close")}
|
|
</button>
|
|
<button
|
|
className={`btn ${confirmButtonStyle}`}
|
|
onClick={() => {
|
|
confirm();
|
|
close();
|
|
}}
|
|
>
|
|
{t("common.confirm")}
|
|
</button>
|
|
</div>
|
|
</Modal>
|
|
);
|
|
};
|
|
|
|
export default ActionConfirmModal;
|