mirror of
https://github.com/Nezumi-2711/react-training.git
synced 2026-09-22 20:01:59 +00:00
Refactor code
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// Styled
|
||||
import { Error, Label, StyledFormRow } from './styled';
|
||||
|
||||
interface IFormRow {
|
||||
label: string;
|
||||
error?: string;
|
||||
children: JSX.Element | JSX.Element[];
|
||||
}
|
||||
|
||||
const FormRow = ({ label, error, children }: IFormRow) => {
|
||||
return (
|
||||
<StyledFormRow>
|
||||
<Label>{label}</Label>
|
||||
<div>
|
||||
{children}
|
||||
{error && <Error>{error}</Error>}
|
||||
</div>
|
||||
</StyledFormRow>
|
||||
);
|
||||
};
|
||||
|
||||
export default FormRow;
|
||||
Reference in New Issue
Block a user