shibafu 407fd192bd Revert "Revert "Release 20200823.1100""
This reverts commit 1b5f690f4e3f58b38562d29384b571edb7aecdb3.
2020-08-30 13:57:02 +09:00

17 lines
541 B
TypeScript

import React from 'react';
type FieldErrorProps = {
errors?: string[];
};
export const FieldError: React.FC<FieldErrorProps> = ({ errors }) =>
(errors && errors.length > 0 && <div className="invalid-feedback">{errors[0]}</div>) || null;
export const StandaloneFieldError: React.FC<FieldErrorProps> = ({ errors }) =>
(errors && errors.length > 0 && (
<div className="form-group col-sm-12" style={{ marginTop: '-1rem' }}>
<small className="text-danger">{errors[0]}</small>
</div>
)) ||
null;