This commit is contained in:
Laux Dev
2026-03-06 09:21:17 +08:00
parent 9b23841876
commit c1e11d7f1c

View File

@@ -5,13 +5,19 @@ import SecondaryButton from "../buttons/secondaryButton/SecondaryButton";
import PrimaryButton from "../buttons/primarybutton/PrimaryButton";
const Alert = (props) => {
const [hide, setHide] = useState(false);
const body = props?.body;
const handleHide = () => {
setHide(true);
setTimeout(() => {
props.setTriggerAlert(false);
if (props?.editState) {
}, 250);
};
const handleConfirm = () => {
setHide(true);
setTimeout(() => {
props.setTriggerAlert(false);
props?.setEditState(false);
}
}, 250);
};
return (
@@ -27,17 +33,12 @@ const Alert = (props) => {
</div>
<div className={styles.alertBody}>
<p>
{props?.body ||
{body ||
" You are about to add a new record. Please review the details before continuing. Do you want to proceed?"}
</p>
</div>
<div className={styles.actionButtons}>
<PrimaryButton
text="Confirm"
onClick={() => {
handleHide();
}}
/>
<PrimaryButton text="Confirm" onClick={handleConfirm} />
<SecondaryButton text="Cancel" onClick={handleHide} />
</div>
</div>