/
dbataeva
/
tasksApp
Обзор
Документация
Войти
/
dbataeva
/
tasksApp
Код
Запросы
2
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
task8
uiLib/src/Input/Input.tsx
33 строки
831 B
Daria Bataeva
feat(task7): add swc builder
29 окт 2025, 21:25
29 окт 2025, 21:25
fe276a9
Код
Авторство
О чём код?
import { FormikHandlers } from 'formik'; import React, { FC, HTMLInputTypeAttribute, memo } from 'react'; type InputProps = { id?: string; label: string; name?: string; error?: string; value?: string | number; type?: HTMLInputTypeAttribute; handleChange: FormikHandlers['handleChange']; }; export const Input: FC<InputProps> = memo( ({ id, label, type, name, handleChange, value, error }) => { return ( <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}> <div style={{ display: 'flex', gap: 10, justifyContent: 'space-between' }}> <label htmlFor={name}>{label}: </label> <input id={id} type={type} name={name} value={value} onChange={handleChange} /> </div> {!!error && <div style={{ color: 'brown' }}>{error}</div>} </div> ); } );