@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
20 lines (19 loc) • 1.75 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const material_1 = require("@mui/material");
const BaseDialog_1 = tslib_1.__importDefault(require("../../shared/BaseDialog"));
const react_intl_1 = require("react-intl");
const react_1 = require("react");
function CoursePublicationDialog(props) {
// PROPS
const { onSubmit, onClose } = props;
// HANDLERS
const handleSubmit = (0, react_1.useCallback)(() => {
onSubmit();
onClose();
}, [onSubmit, onClose]);
return ((0, jsx_runtime_1.jsx)(BaseDialog_1.default, Object.assign({ open: true, DialogContentProps: { dividers: false }, onClose: onClose, title: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.edit.dialog.title", defaultMessage: "ui.courseForm.edit.dialog.title" }) })), actions: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", color: "primary", variant: "contained", onClick: handleSubmit }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.edit.dialog.btn", defaultMessage: "ui.courseForm.edit.dialog.btn" }) })) })) }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.edit.dialog.description", defaultMessage: "ui.courseForm.edit.dialog.description" }) })) })));
}
exports.default = (0, react_1.memo)(CoursePublicationDialog);