chore: added recursive goals to monitor page

This commit is contained in:
Pim Hutting
2026-01-20 12:31:34 +01:00
parent 2ca0c9c4c0
commit a8f9965391
3 changed files with 61 additions and 6 deletions

View File

@@ -91,13 +91,14 @@ export const DirectSpeechInput: React.FC = () => {
};
// --- interface for goals/triggers/norms/conditional norms ---
type StatusItem = {
export type StatusItem = {
id?: string | number;
achieved?: boolean;
description?: string;
label?: string;
norm?: string;
name?: string;
level?: number;
};
interface StatusListProps {
@@ -129,7 +130,7 @@ export const StatusList: React.FC<StatusListProps> = ({
const isCurrentGoal = type === 'goal' && idx === currentGoalIndex;
const canOverride = (showIndicator && !isActive) || (type === 'cond_norm' && isActive);
const indentation = (item.level || 0) * 20;
const handleOverrideClick = () => {
if (!canOverride) return;
@@ -147,7 +148,10 @@ export const StatusList: React.FC<StatusListProps> = ({
};
return (
<li key={item.id ?? idx} className={styles.statusItem}>
<li key={item.id ?? idx}
className={styles.statusItem}
style={{ paddingLeft: `${indentation}px` }}
>
{showIndicator && (
<span
className={`${styles.statusIndicator} ${isActive ? styles.active : styles.inactive} ${canOverride ? styles.clickable : ''}`}