chore: made activatable elements clickable

ref: N25B-400
This commit is contained in:
Pim Hutting
2026-01-12 19:41:05 +01:00
parent c4a4c52ecc
commit 46d900305a
3 changed files with 34 additions and 3 deletions

View File

@@ -131,12 +131,11 @@ export const StatusList: React.FC<StatusListProps> = ({
<h3>{title}</h3>
<ul>
{items.map((item, idx) => {
if (item.id === undefined) return null;
const isActive = !!activeIds[item.id];
const showIndicator = type !== 'norm';
const canOverride = showIndicator && !isActive;
// HIGHLIGHT LOGIC:
// If this is the "Goals" list, check if the current index matches
const isCurrentGoal = type === 'goal' && idx === currentGoalIndex;
const handleOverrideClick = () => {
@@ -148,7 +147,7 @@ export const StatusList: React.FC<StatusListProps> = ({
<li key={item.id ?? idx} className={styles.statusItem}>
{showIndicator && (
<span
className={`${styles.statusIndicator} ${canOverride ? styles.clickable : ''}`}
className={`${styles.statusIndicator} ${isActive ? styles.active : styles.inactive} ${canOverride ? styles.clickable : ''}`}
onClick={handleOverrideClick}
>
{isActive ? "✔️" : "❌"}

View File

@@ -156,6 +156,37 @@
content: '✔️ ';
}
.statusIndicator {
display: inline-block;
margin-right: 10px;
user-select: none;
transition: transform 0.1s ease;
font-size: 1.1rem;
}
.clickable {
cursor: pointer;
}
.clickable:hover {
transform: scale(1.2);
}
.active {
cursor: default;
opacity: 1;
}
.statusItem {
display: flex;
align-items: center;
margin-bottom: 0.4rem;
}
.itemDescription {
line-height: 1.4;
}
/* LOGS */
.logs {
grid-area: logs;

View File

@@ -73,6 +73,7 @@ const MonitoringPage: React.FC = () => {
data.norms.forEach((normUpdate: { id: string; active: boolean }) => {
nextState[normUpdate.id] = normUpdate.active;
console.log(`Conditional norm ${normUpdate.id} set to active: ${normUpdate.active}`);
});
return nextState;