AI and personalities

This commit is contained in:
Tomasz Rewak
2023-05-15 18:11:18 +02:00
parent e44b15c91a
commit 9f3b8a616d
5 changed files with 266 additions and 24 deletions
+12 -9
View File
@@ -1,10 +1,7 @@
import React from 'react';
function useColor(status, processing) {
if (processing)
return '#f1f1f1';
function useColor(status) {
if (status === 'yes')
return '#52e691';
@@ -14,16 +11,22 @@ function useColor(status, processing) {
if (status === 'info')
return '#3caee0';
if (status == 'conditional')
return 'repeating-linear-gradient(56deg, rgb(82, 230, 145) 0px, rgb(82, 230, 145) 30px, #82cd68 30px, #82cd68 60px)';
throw new Error(`Invalid status: ${status}`);
}
export default function WiseMan(props) {
const { setProps, name, order_number, question_id, answer } = props;
const fullName = `${name.toUpperCase()}${order_number}`;
const color = useColor(answer['status'], question_id !== answer['id']);
const color = useColor(answer['status']);
const processing = question_id !== answer['id'];
return React.createElement('div', { className: `wise-man ${name}`, style: { background: color } },
[
fullName
])
return React.createElement('div', { className: `wise-man ${name}` },
[
React.createElement('div', { className: `inner ${processing ? 'flicker' : ''}`, style: { background: color } }, [
fullName
])
])
}