UNPKG

ra-core

Version:

Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React

34 lines 1.78 kB
import * as React from 'react'; import { Translate } from "../i18n/Translate.js"; export const Confirm = ({ isOpen, content, onClose, onConfirm, title, translateOptions = {}, titleTranslateOptions = translateOptions, contentTranslateOptions = translateOptions, }) => { return isOpen ? (React.createElement("div", { style: { position: 'fixed', top: 0, left: 0, right: 0, bottom: 0, display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: 'rgba(0, 0, 0, 0.3)', } }, React.createElement("div", { style: { backgroundColor: 'rgba(0, 0, 0, 0.8)', color: 'white', padding: '1em', } }, React.createElement("p", null, typeof title === 'string' ? (React.createElement(Translate, { i18nKey: title, options: { _: title, ...titleTranslateOptions, } })) : (title)), React.createElement("p", null, typeof content === 'string' ? (React.createElement(Translate, { i18nKey: content, options: { _: content, ...contentTranslateOptions, } })) : (content)), React.createElement("div", { style: { display: 'flex', gap: '1em' } }, React.createElement("button", { onClick: onConfirm, type: "button" }, React.createElement(Translate, { i18nKey: "ra.action.confirm" }, "Confirm")), React.createElement("button", { onClick: onClose, type: "button" }, React.createElement(Translate, { i18nKey: "ra.action.cancel" }, "Cancel")))))) : null; }; //# sourceMappingURL=Confirm.js.map