/
TimurIsm
/
OpenEyes
Обзор
Документация
Войти
/
TimurIsm
/
OpenEyes
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
front/src/components/TestResultNotification.jsx
46 строк
1 KB
TimurIsm
first_commit
16 май 2026, 15:34
16 май 2026, 15:34
4d3f198
Код
Авторство
О чём код?
import React from 'react'; const TestResultNotification = ({ analysis }) => { if (!analysis || !analysis.showNotification) return null; const getColorStyles = () => { switch (analysis.color) { case 'green': return { bg: 'bg-gradient-to-r from-green-50 to-emerald-50', border: 'border-green-200', textColor: 'text-green-800' }; case 'red': return { bg: 'bg-gradient-to-r from-red-50 to-rose-50', border: 'border-red-200', textColor: 'text-red-800' }; case 'orange': return { bg: 'bg-gradient-to-r from-orange-50 to-amber-50', border: 'border-orange-200', textColor: 'text-orange-800' }; default: return { bg: 'bg-gradient-to-r from-blue-50 to-indigo-50', border: 'border-blue-200', textColor: 'text-blue-800' }; } }; const styles = getColorStyles(); return ( <div className={`mb-4 p-2 rounded-xl border-2 ${styles.bg} ${styles.border} animate-slideDown`}> <p className={`text-sm leading-relaxed ${styles.textColor}`}> {analysis.message} </p> </div> ); }; export default TestResultNotification;