1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2025-06-16 13:46:16 +02:00

Display actual error within the form.

This commit is contained in:
Maciej Lenartowicz
2020-01-20 16:54:42 +01:00
parent a0a775996e
commit ee33d33738
30 changed files with 165 additions and 156 deletions

View File

@ -6,11 +6,18 @@
*/
import React from "react";
import PropTypes from "prop-types";
export function ErrorMessage() {
ErrorMessage.propTypes = {
message: PropTypes.string,
};
ErrorMessage.defaultProps = {
message: _("An error occurred while fetching data."),
};
export function ErrorMessage({ message }) {
return (
<p className="text-center text-danger">
{_("An error occurred while fetching data.")}
</p>
<p className="text-center text-danger">{message}</p>
);
}