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