mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-07-28 17:53:21 +08:00
chore: update clear data modal in setting
This commit is contained in:
20
components/ClearDataButton.tsx
Normal file
20
components/ClearDataButton.tsx
Normal file
@ -0,0 +1,20 @@
|
||||
import { useState } from "react";
|
||||
import { createPortal } from "react-dom";
|
||||
import ClearDataConfirmModal from "./ClearDataConfirmModal";
|
||||
|
||||
const ClearDataButton = () => {
|
||||
const [showClearDataConfirmModal, setShowClearDataConfirmModal] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<button className="btn btn-sm btn-error" onClick={() => setShowClearDataConfirmModal(true)}>
|
||||
Clear
|
||||
</button>
|
||||
|
||||
{showClearDataConfirmModal &&
|
||||
createPortal(<ClearDataConfirmModal close={() => setShowClearDataConfirmModal(false)} />, document.body)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default ClearDataButton;
|
Reference in New Issue
Block a user