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:
@ -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>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user