Skip to content

Delete Dialog

Usage Example

const deleteSomething = async () => {
  const res = await new Promise<boolean>((res) => {
    modalStore
      .push(SCADeleteDialog, { title: "Delete something?" }, {}, { closeOnOverlayClick: false })
      .onClose<"confirm" | "cancel" | "abort">((data) => {
        if (!data || data === "abort" || data === "cancel") {
          res(false);
        } else {
          res(true);
        }
      });
  });
  if (!res) {
    return;
  }
  // DELETE CODE HERE...
};

Button Texts