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