UNPKG

@primer/react

Version:

An implementation of GitHub's Primer Design System using React

51 lines (47 loc) 1.22 kB
'use strict'; var reactCompilerRuntime = require('react-compiler-runtime'); var ConfirmationDialog = require('../ConfirmationDialog/ConfirmationDialog.js'); var jsxRuntime = require('react/jsx-runtime'); function ErrorDialog(t0) { const $ = reactCompilerRuntime.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__*/jsxRuntime.jsx(ConfirmationDialog.ConfirmationDialog, { title: title, onClose: t2, confirmButtonContent: "Retry", cancelButtonContent: "Dismiss", children: children }); $[3] = children; $[4] = t2; $[5] = title; $[6] = t3; } else { t3 = $[6]; } return t3; } exports.ErrorDialog = ErrorDialog;