fixed
This commit is contained in:
@@ -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) {
|
||||
props?.setEditState(false);
|
||||
}
|
||||
}, 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>
|
||||
|
||||
Reference in New Issue
Block a user