/
TimurIsm
/
OpenEyes
Обзор
Документация
Войти
/
TimurIsm
/
OpenEyes
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
front/src/components/AddTestInput.jsx
51 строка
1 KB
IsmTimur
Initial commit: added backend (Express) and frontend (React Vite)
19 июн 2025, 18:32
19 июн 2025, 18:32
6cf6155
Код
Авторство
О чём код?
import React from 'react'; const AddTestInput = ({ label, id, value, onChange, placeholder, required, type = 'text', textarea = false, maxLength, currentLength, showCounter = true }) => { return ( <div className="mb-6"> <label htmlFor={id} className="block mb-2 text-lg font-medium text-gray-900"> {label} {(showCounter || maxLength) && ( <span className="text-sm text-gray-500 ml-2"> {currentLength}{maxLength ? `/${maxLength}` : ''} </span> )} </label> {textarea ? ( <textarea id={id} className="bg-gray-50 border border-gray-300 text-gray-900 text-md rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5" value={value} onChange={onChange} required={required} maxLength={maxLength} /> ) : ( <input id={id} type={type} className="bg-gray-50 border border-gray-300 text-gray-900 text-md rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5" value={value} onChange={onChange} placeholder={placeholder} required={required} maxLength={maxLength} /> )} </div> ); }; export default AddTestInput;