/
TimurIsm
/
OpenEyes
Обзор
Документация
Войти
/
TimurIsm
/
OpenEyes
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
front/src/components/AnswerInput.jsx
29 строк
899 B
IsmTimur
Initial commit: added backend (Express) and frontend (React Vite)
19 июн 2025, 18:32
19 июн 2025, 18:32
6cf6155
Код
Авторство
О чём код?
import React from 'react'; import AlertMessage from '../components/AlertMessage'; const AnswerInput = ({ value, onChange, alertMessage }) => { const handleInputChange = (e) => { const newValue = e.target.value.slice(0, 100); onChange({ ...e, target: { ...e.target, value: newValue } }); }; return ( <> <input type="text" placeholder="Введите ответ" value={value} onChange={handleInputChange} maxLength={100} className="w-full p-2 border border-gray-400 rounded-lg" /> {alertMessage.message && ( <div className="w-full"> <AlertMessage type={alertMessage.type} message={alertMessage.message} /> </div> )} </> ); }; export default AnswerInput;