mirror of
https://github.com/Nezumi-2711/react-training.git
synced 2026-09-22 13:38:51 +00:00
23 lines
427 B
TypeScript
23 lines
427 B
TypeScript
// 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;
|