import React from "react"; import { Button, DialogContentText } from "@material-ui/core"; import { FormattedMessage, useIntl } from "react-intl"; import { ErrorInfo } from "../../../../client"; import { StyledDialog, StyledDialogActions, StyledDialogContent, StyledDialogTitle } from "./style"; import GlobalError from "../../../form/global-error"; export type DialogProps = { onClose: () => void; onSubmit?: (event: React.FormEvent) => void; children: any; error?: ErrorInfo; title: string; description?: string; submitButton?: string; actionUrl?: string; } const BaseDialog = (props: DialogProps) => { const intl = useIntl(); const { onClose, onSubmit, actionUrl = "" } = props; const handleOnSubmit = (e: React.FormEvent) => { e.preventDefault(); if (onSubmit) { onSubmit(e); } } const description = props.description ? ({props.description}) : null; return (
{props.title} {description} {props.children} {onSubmit && }
); } export default BaseDialog;