/* eslint-disable react/no-multi-comp */ import {IFormGroup, IBaseRestApiResponse, IGenericListPageComponent} from 'superdesk-api'; import {superdeskApi} from '../../superdeskApi'; import React from 'react'; import PropTypes from 'prop-types'; import {Modal} from '../index'; import {planningEventTemplateEvents} from '../../actions/events/notifications'; interface IProps { handleHide(): void; } interface IEventTemplate extends IBaseRestApiResponse { template_name: string; } export class ManageEventTemplatesModal extends React.PureComponent { static propTypes: any; render() { const {handleHide} = this.props; const {getGenericListPageComponent, ListItemColumn, ListItem} = superdeskApi.components; const {getFormFieldPreviewComponent, FormFieldType} = superdeskApi.forms; const {gettext} = superdeskApi.localization; const nameField = { label: gettext('Template name'), type: FormFieldType.textSingleLine, field: 'template_name', required: true, }; const formConfig: IFormGroup = { direction: 'vertical', type: 'inline', form: [ nameField, ], }; const EventTemplatesComponent = getGenericListPageComponent( 'events_template', formConfig ); const renderRow = ( key: string, item: IEventTemplate, page: IGenericListPageComponent ) => ( {getFormFieldPreviewComponent(item, nameField)}
); return (

{gettext('Manage Event Templates')}

); } } ManageEventTemplatesModal.propTypes = { handleHide: PropTypes.func, };