@primer/react
Version:
An implementation of GitHub's Primer Design System using React
37 lines (36 loc) • 1.01 kB
JavaScript
import { ConfirmationDialog } from "../ConfirmationDialog/ConfirmationDialog.js";
import { c } from "react-compiler-runtime";
import { jsx } from "react/jsx-runtime";
//#region src/DataTable/ErrorDialog.tsx
function ErrorDialog(t0) {
const $ = c(7);
const { title: t1, children, onRetry, onDismiss } = t0;
const title = t1 === void 0 ? "Error" : t1;
let t2;
if ($[0] !== onDismiss || $[1] !== onRetry) {
t2 = (gesture) => {
if (gesture === "confirm") onRetry === null || onRetry === void 0 || onRetry();
else onDismiss === null || onDismiss === void 0 || onDismiss();
};
$[0] = onDismiss;
$[1] = onRetry;
$[2] = t2;
} else t2 = $[2];
let t3;
if ($[3] !== children || $[4] !== t2 || $[5] !== title) {
t3 = /*#__PURE__*/ jsx(ConfirmationDialog, {
title,
onClose: t2,
confirmButtonContent: "Retry",
cancelButtonContent: "Dismiss",
children
});
$[3] = children;
$[4] = t2;
$[5] = title;
$[6] = t3;
} else t3 = $[6];
return t3;
}
//#endregion
export { ErrorDialog };