UNPKG

@craftercms/studio-ui

Version:

Services, components, models & utils to build CrafterCMS authoring extensions.

89 lines (87 loc) 3.21 kB
/* * Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 3 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* * Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import { FormattedMessage } from 'react-intl'; import DialogBody from '../DialogBody/DialogBody'; import Grid from '@mui/material/Grid'; import List from '@mui/material/List'; import ListItem from '@mui/material/ListItem'; import ListItemText from '@mui/material/ListItemText'; import DialogFooter from '../DialogFooter/DialogFooter'; import SecondaryButton from '../SecondaryButton'; import PrimaryButton from '../PrimaryButton'; import React from 'react'; export function WorkflowCancellationDialogUI(props) { const { resource, onCloseButtonClick, onContinue, classes } = props; const items = resource.read(); return React.createElement( React.Fragment, null, React.createElement( DialogBody, null, React.createElement( Grid, { container: true, spacing: 3 }, React.createElement( Grid, { item: true, xs: 12 }, React.createElement( List, { className: classes.filesList }, items.map((item) => React.createElement( ListItem, { key: item.path }, React.createElement(ListItemText, { primary: item.label, secondary: item.path }) ) ) ) ) ) ), React.createElement( DialogFooter, null, onCloseButtonClick && React.createElement( SecondaryButton, { onClick: onCloseButtonClick }, React.createElement(FormattedMessage, { id: 'workflowCancellation.cancel', defaultMessage: 'Cancel' }) ), onContinue && React.createElement( PrimaryButton, { onClick: onContinue, autoFocus: true }, React.createElement(FormattedMessage, { id: 'workflowCancellation.continue', defaultMessage: 'Continue' }) ) ) ); }