mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-08 05:51:47 -07:00
Initial Commit Rework
This commit is contained in:
parent
74a4cc048c
commit
95051cbd63
2483 changed files with 101351 additions and 111396 deletions
52
frontend/src/Components/Form/Form.js
Normal file
52
frontend/src/Components/Form/Form.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import styles from './Form.css';
|
||||
|
||||
function Form({ children, validationErrors, validationWarnings, ...otherProps }) {
|
||||
return (
|
||||
<div>
|
||||
<div>
|
||||
{
|
||||
validationErrors.map((error, index) => {
|
||||
return (
|
||||
<div
|
||||
key={index}
|
||||
className={styles.error}
|
||||
>
|
||||
{error.errorMessage}
|
||||
</div>
|
||||
);
|
||||
})
|
||||
}
|
||||
|
||||
{
|
||||
validationWarnings.map((warning, index) => {
|
||||
return (
|
||||
<div
|
||||
key={index}
|
||||
className={styles.error}
|
||||
>
|
||||
{warning.errorMessage}
|
||||
</div>
|
||||
);
|
||||
})
|
||||
}
|
||||
</div>
|
||||
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Form.propTypes = {
|
||||
children: PropTypes.node.isRequired,
|
||||
validationErrors: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
validationWarnings: PropTypes.arrayOf(PropTypes.object).isRequired
|
||||
};
|
||||
|
||||
Form.defaultProps = {
|
||||
validationErrors: [],
|
||||
validationWarnings: []
|
||||
};
|
||||
|
||||
export default Form;
|
Loading…
Add table
Add a link
Reference in a new issue