@konstructio/ui
Version:
A set of reusable and customizable React components built for konstruct.io
11 lines (10 loc) • 328 B
JavaScript
import { useState as u, useCallback as t } from "react";
const d = ({ onConfirm: e }) => {
const [a, s] = u(!1), l = t(() => s(!0), []), c = t(() => s(!1), []), p = t(() => {
e == null || e(), s(!1);
}, [e]);
return { isOpen: a, handleCancel: c, handleConfirm: p, handleOpen: l };
};
export {
d as useAlertDialog
};