@contractspec/example.learning-journey-ui-coaching 3.7.5 → 3.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +3 -3
- package/AGENTS.md +50 -25
- package/CHANGELOG.md +14 -0
- package/README.md +63 -20
- package/dist/CoachingMiniApp.js +178 -178
- package/dist/browser/CoachingMiniApp.js +178 -178
- package/dist/browser/components/EngagementMeter.js +2 -2
- package/dist/browser/components/TipCard.js +3 -3
- package/dist/browser/components/TipFeed.js +6 -6
- package/dist/browser/components/index.js +11 -11
- package/dist/browser/index.js +179 -178
- package/dist/browser/views/Overview.js +16 -16
- package/dist/browser/views/Progress.js +10 -10
- package/dist/browser/views/Steps.js +6 -6
- package/dist/browser/views/Timeline.js +9 -9
- package/dist/browser/views/index.js +174 -174
- package/dist/components/EngagementMeter.js +2 -2
- package/dist/components/TipCard.js +3 -3
- package/dist/components/TipFeed.js +6 -6
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +11 -11
- package/dist/index.d.ts +3 -3
- package/dist/index.js +179 -178
- package/dist/node/CoachingMiniApp.js +178 -178
- package/dist/node/components/EngagementMeter.js +2 -2
- package/dist/node/components/TipCard.js +3 -3
- package/dist/node/components/TipFeed.js +6 -6
- package/dist/node/components/index.js +11 -11
- package/dist/node/index.js +179 -178
- package/dist/node/views/Overview.js +16 -16
- package/dist/node/views/Progress.js +10 -10
- package/dist/node/views/Steps.js +6 -6
- package/dist/node/views/Timeline.js +9 -9
- package/dist/node/views/index.js +174 -174
- package/dist/views/Overview.js +16 -16
- package/dist/views/Progress.js +10 -10
- package/dist/views/Steps.js +6 -6
- package/dist/views/Timeline.js +9 -9
- package/dist/views/index.d.ts +1 -1
- package/dist/views/index.js +174 -174
- package/package.json +12 -12
- package/src/CoachingMiniApp.tsx +70 -70
- package/src/components/EngagementMeter.tsx +82 -82
- package/src/components/TipCard.tsx +81 -81
- package/src/components/TipFeed.tsx +80 -80
- package/src/components/index.ts +1 -1
- package/src/docs/learning-journey-ui-coaching.docblock.ts +10 -10
- package/src/example.ts +25 -25
- package/src/index.ts +4 -6
- package/src/learning-journey-ui-coaching.feature.ts +12 -12
- package/src/views/Overview.tsx +136 -136
- package/src/views/Progress.tsx +146 -146
- package/src/views/Steps.tsx +57 -57
- package/src/views/Timeline.tsx +101 -101
- package/src/views/index.ts +1 -1
- package/tsconfig.json +7 -8
- package/tsdown.config.js +7 -13
|
@@ -4,98 +4,98 @@ import { cn } from '@contractspec/lib.ui-kit-web/ui/utils';
|
|
|
4
4
|
import type { LearningJourneyStepSpec } from '@contractspec/module.learning-journey/track-spec';
|
|
5
5
|
|
|
6
6
|
interface TipFeedItem {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
step: LearningJourneyStepSpec;
|
|
8
|
+
isCompleted: boolean;
|
|
9
|
+
completedAt?: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
interface TipFeedProps {
|
|
13
|
-
|
|
13
|
+
items: TipFeedItem[];
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const TIP_ICONS: Record<string, string> = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
cash_buffer_too_high: '💰',
|
|
18
|
+
no_savings_goal: '🎯',
|
|
19
|
+
irregular_savings: '📅',
|
|
20
|
+
noise_late_evening: '🔇',
|
|
21
|
+
guest_frequency_high: '👥',
|
|
22
|
+
shared_space_conflicts: '🏠',
|
|
23
|
+
default: '💡',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export function TipFeed({ items }: TipFeedProps) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
if (items.length === 0) {
|
|
28
|
+
return (
|
|
29
|
+
<div className="py-8 text-center text-muted-foreground">
|
|
30
|
+
No tips yet. Start engaging with coaching tips!
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
return (
|
|
36
|
+
<div className="relative">
|
|
37
|
+
{/* Timeline line */}
|
|
38
|
+
<div className="absolute top-0 left-4 h-full w-0.5 bg-border" />
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
{/* Feed items */}
|
|
41
|
+
<div className="space-y-4">
|
|
42
|
+
{items.map((item) => {
|
|
43
|
+
const tipId = (item.step.metadata?.tipId as string) ?? 'default';
|
|
44
|
+
const icon = TIP_ICONS[tipId] ?? TIP_ICONS.default;
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
46
|
+
return (
|
|
47
|
+
<div key={item.step.id} className="relative flex gap-4 pl-2">
|
|
48
|
+
{/* Node */}
|
|
49
|
+
<div
|
|
50
|
+
className={cn(
|
|
51
|
+
'relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm',
|
|
52
|
+
item.isCompleted
|
|
53
|
+
? 'bg-green-500 text-white'
|
|
54
|
+
: 'bg-muted text-muted-foreground'
|
|
55
|
+
)}
|
|
56
|
+
>
|
|
57
|
+
{item.isCompleted ? '✓' : icon}
|
|
58
|
+
</div>
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
60
|
+
{/* Content */}
|
|
61
|
+
<div className="flex-1 rounded-lg border bg-card p-3">
|
|
62
|
+
<div className="flex items-start justify-between gap-2">
|
|
63
|
+
<div>
|
|
64
|
+
<p className="font-medium">{item.step.title}</p>
|
|
65
|
+
<p className="mt-0.5 text-muted-foreground text-sm">
|
|
66
|
+
{item.step.description}
|
|
67
|
+
</p>
|
|
68
|
+
</div>
|
|
69
|
+
{item.step.xpReward && (
|
|
70
|
+
<span
|
|
71
|
+
className={cn(
|
|
72
|
+
'shrink-0 font-medium text-xs',
|
|
73
|
+
item.isCompleted
|
|
74
|
+
? 'text-green-500'
|
|
75
|
+
: 'text-muted-foreground'
|
|
76
|
+
)}
|
|
77
|
+
>
|
|
78
|
+
+{item.step.xpReward} XP
|
|
79
|
+
</span>
|
|
80
|
+
)}
|
|
81
|
+
</div>
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
83
|
+
{/* Timestamp */}
|
|
84
|
+
<div className="mt-2 flex items-center gap-2 text-muted-foreground text-xs">
|
|
85
|
+
{item.isCompleted ? (
|
|
86
|
+
<span className="text-green-500">
|
|
87
|
+
✓ Completed
|
|
88
|
+
{item.completedAt && ` • ${item.completedAt}`}
|
|
89
|
+
</span>
|
|
90
|
+
) : (
|
|
91
|
+
<span>Pending action</span>
|
|
92
|
+
)}
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
);
|
|
97
|
+
})}
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
);
|
|
101
101
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -2,16 +2,16 @@ import type { DocBlock } from '@contractspec/lib.contracts-spec/docs';
|
|
|
2
2
|
import { registerDocBlocks } from '@contractspec/lib.contracts-spec/docs';
|
|
3
3
|
|
|
4
4
|
const blocks: DocBlock[] = [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
{
|
|
6
|
+
id: 'docs.examples.learning-journey-ui-coaching',
|
|
7
|
+
title: 'Learning Journey UI — Coaching',
|
|
8
|
+
summary: 'UI mini-app components for coaching: tips, engagement, progress.',
|
|
9
|
+
kind: 'reference',
|
|
10
|
+
visibility: 'public',
|
|
11
|
+
route: '/docs/examples/learning-journey-ui-coaching',
|
|
12
|
+
tags: ['learning', 'ui', 'coaching'],
|
|
13
|
+
body: `## Includes\n- Coaching mini-app shell\n- Views: overview, steps, progress, timeline\n- Components: tip card, engagement meter, tip feed\n\n## Notes\n- Compose using design system components.\n- Keep accessibility and mobile-friendly tap targets.`,
|
|
14
|
+
},
|
|
15
15
|
];
|
|
16
16
|
|
|
17
17
|
registerDocBlocks(blocks);
|
package/src/example.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { defineExample } from '@contractspec/lib.contracts-spec';
|
|
2
2
|
|
|
3
3
|
const example = defineExample({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
4
|
+
meta: {
|
|
5
|
+
key: 'learning-journey-ui-coaching',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
title: 'Learning Journey UI — Coaching',
|
|
8
|
+
description:
|
|
9
|
+
'UI mini-app for coaching patterns: tips, engagement meter, progress.',
|
|
10
|
+
kind: 'ui',
|
|
11
|
+
visibility: 'public',
|
|
12
|
+
stability: 'experimental',
|
|
13
|
+
owners: ['@platform.core'],
|
|
14
|
+
tags: ['learning', 'ui', 'coaching'],
|
|
15
|
+
},
|
|
16
|
+
docs: {
|
|
17
|
+
rootDocId: 'docs.examples.learning-journey-ui-coaching',
|
|
18
|
+
},
|
|
19
|
+
entrypoints: {
|
|
20
|
+
packageName: '@contractspec/example.learning-journey-ui-coaching',
|
|
21
|
+
docs: './docs',
|
|
22
|
+
},
|
|
23
|
+
surfaces: {
|
|
24
|
+
templates: true,
|
|
25
|
+
sandbox: { enabled: true, modes: ['playground', 'markdown'] },
|
|
26
|
+
studio: { enabled: true, installable: true },
|
|
27
|
+
mcp: { enabled: true },
|
|
28
|
+
},
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
export default example;
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
// Main mini-app
|
|
2
2
|
export { CoachingMiniApp } from './CoachingMiniApp';
|
|
3
|
-
|
|
4
|
-
// Views
|
|
5
|
-
export { Overview, Steps, Progress, Timeline } from './views';
|
|
6
|
-
|
|
7
3
|
// Components
|
|
8
|
-
export {
|
|
9
|
-
export * from './learning-journey-ui-coaching.feature';
|
|
4
|
+
export { EngagementMeter, TipCard, TipFeed } from './components';
|
|
10
5
|
export { default as example } from './example';
|
|
6
|
+
export * from './learning-journey-ui-coaching.feature';
|
|
7
|
+
// Views
|
|
8
|
+
export { Overview, Progress, Steps, Timeline } from './views';
|
|
11
9
|
import './docs';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { defineFeature } from '@contractspec/lib.contracts-spec';
|
|
2
2
|
|
|
3
3
|
export const LearningJourneyUiCoachingFeature = defineFeature({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
meta: {
|
|
5
|
+
key: 'learning-journey-ui-coaching',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
title: 'Learning Journey UI: Coaching',
|
|
8
|
+
description:
|
|
9
|
+
'Coaching UI with tip cards, engagement tracking, and multi-view navigation',
|
|
10
|
+
domain: 'learning-journey',
|
|
11
|
+
owners: ['@examples'],
|
|
12
|
+
tags: ['learning', 'ui', 'coaching', 'tips'],
|
|
13
|
+
stability: 'experimental',
|
|
14
|
+
},
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
docs: ['docs.examples.learning-journey-ui-coaching'],
|
|
17
17
|
});
|
package/src/views/Overview.tsx
CHANGED
|
@@ -1,157 +1,157 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import type { LearningViewProps } from '@contractspec/example.learning-journey-ui-shared';
|
|
4
|
+
import {
|
|
5
|
+
StreakCounter,
|
|
6
|
+
XpBar,
|
|
7
|
+
} from '@contractspec/example.learning-journey-ui-shared';
|
|
3
8
|
import { Button } from '@contractspec/lib.design-system';
|
|
4
9
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
Card,
|
|
11
|
+
CardContent,
|
|
12
|
+
CardHeader,
|
|
13
|
+
CardTitle,
|
|
9
14
|
} from '@contractspec/lib.ui-kit-web/ui/card';
|
|
10
|
-
import {
|
|
11
|
-
XpBar,
|
|
12
|
-
StreakCounter,
|
|
13
|
-
} from '@contractspec/example.learning-journey-ui-shared';
|
|
14
15
|
import { TipCard } from '../components/TipCard';
|
|
15
|
-
import type { LearningViewProps } from '@contractspec/example.learning-journey-ui-shared';
|
|
16
16
|
|
|
17
17
|
interface CoachingOverviewProps extends LearningViewProps {
|
|
18
|
-
|
|
18
|
+
onStart?: () => void;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export function Overview({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
track,
|
|
23
|
+
progress,
|
|
24
|
+
onStepComplete,
|
|
25
|
+
onStart,
|
|
26
26
|
}: CoachingOverviewProps) {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const totalXp =
|
|
28
|
+
track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0);
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const completedSteps = progress.completedStepIds.length;
|
|
31
|
+
const totalSteps = track.steps.length;
|
|
32
|
+
const pendingSteps = totalSteps - completedSteps;
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
// Get active tips (incomplete ones)
|
|
35
|
+
const activeTips = track.steps
|
|
36
|
+
.filter((s) => !progress.completedStepIds.includes(s.id))
|
|
37
|
+
.slice(0, 3);
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
39
|
+
return (
|
|
40
|
+
<div className="space-y-6">
|
|
41
|
+
{/* Header Card */}
|
|
42
|
+
<Card className="overflow-hidden bg-gradient-to-br from-amber-500/10 via-orange-500/10 to-red-500/10">
|
|
43
|
+
<CardContent className="p-6">
|
|
44
|
+
<div className="flex flex-col items-center gap-4 text-center md:flex-row md:text-left">
|
|
45
|
+
<div className="flex h-16 w-16 items-center justify-center rounded-2xl bg-gradient-to-br from-amber-500 to-orange-600 text-3xl shadow-lg">
|
|
46
|
+
💡
|
|
47
|
+
</div>
|
|
48
|
+
<div className="flex-1">
|
|
49
|
+
<h1 className="font-bold text-2xl">{track.name}</h1>
|
|
50
|
+
<p className="mt-1 text-muted-foreground">{track.description}</p>
|
|
51
|
+
</div>
|
|
52
|
+
<div className="flex items-center gap-4">
|
|
53
|
+
<StreakCounter days={progress.streakDays} size="lg" />
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</CardContent>
|
|
57
|
+
</Card>
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
59
|
+
{/* Quick Stats */}
|
|
60
|
+
<div className="grid gap-4 md:grid-cols-3">
|
|
61
|
+
<Card>
|
|
62
|
+
<CardHeader className="pb-2">
|
|
63
|
+
<CardTitle className="font-medium text-muted-foreground text-sm">
|
|
64
|
+
Active Tips
|
|
65
|
+
</CardTitle>
|
|
66
|
+
</CardHeader>
|
|
67
|
+
<CardContent>
|
|
68
|
+
<div className="font-bold text-3xl text-amber-500">
|
|
69
|
+
{pendingSteps}
|
|
70
|
+
</div>
|
|
71
|
+
<p className="text-muted-foreground text-sm">tips for you today</p>
|
|
72
|
+
</CardContent>
|
|
73
|
+
</Card>
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
75
|
+
<Card>
|
|
76
|
+
<CardHeader className="pb-2">
|
|
77
|
+
<CardTitle className="font-medium text-muted-foreground text-sm">
|
|
78
|
+
Tips Actioned
|
|
79
|
+
</CardTitle>
|
|
80
|
+
</CardHeader>
|
|
81
|
+
<CardContent>
|
|
82
|
+
<div className="font-bold text-3xl text-green-500">
|
|
83
|
+
{completedSteps}
|
|
84
|
+
</div>
|
|
85
|
+
<p className="text-muted-foreground text-sm">
|
|
86
|
+
out of {totalSteps} total
|
|
87
|
+
</p>
|
|
88
|
+
</CardContent>
|
|
89
|
+
</Card>
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
91
|
+
<Card>
|
|
92
|
+
<CardHeader className="pb-2">
|
|
93
|
+
<CardTitle className="font-medium text-muted-foreground text-sm">
|
|
94
|
+
XP Earned
|
|
95
|
+
</CardTitle>
|
|
96
|
+
</CardHeader>
|
|
97
|
+
<CardContent>
|
|
98
|
+
<div className="font-bold text-3xl text-orange-500">
|
|
99
|
+
{progress.xpEarned}
|
|
100
|
+
</div>
|
|
101
|
+
<XpBar
|
|
102
|
+
current={progress.xpEarned}
|
|
103
|
+
max={totalXp}
|
|
104
|
+
showLabel={false}
|
|
105
|
+
size="sm"
|
|
106
|
+
/>
|
|
107
|
+
</CardContent>
|
|
108
|
+
</Card>
|
|
109
|
+
</div>
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
111
|
+
{/* Active Tips Preview */}
|
|
112
|
+
{activeTips.length > 0 && (
|
|
113
|
+
<Card>
|
|
114
|
+
<CardHeader className="flex flex-row items-center justify-between">
|
|
115
|
+
<CardTitle className="flex items-center gap-2">
|
|
116
|
+
<span>💡</span>
|
|
117
|
+
<span>Tips for You</span>
|
|
118
|
+
</CardTitle>
|
|
119
|
+
{activeTips.length < pendingSteps && (
|
|
120
|
+
<Button variant="outline" size="sm" onClick={onStart}>
|
|
121
|
+
View All ({pendingSteps})
|
|
122
|
+
</Button>
|
|
123
|
+
)}
|
|
124
|
+
</CardHeader>
|
|
125
|
+
<CardContent className="space-y-3">
|
|
126
|
+
{activeTips.map((step) => (
|
|
127
|
+
<TipCard
|
|
128
|
+
key={step.id}
|
|
129
|
+
step={step}
|
|
130
|
+
isCompleted={false}
|
|
131
|
+
isCurrent={step.id === activeTips[0]?.id}
|
|
132
|
+
onComplete={() => onStepComplete?.(step.id)}
|
|
133
|
+
/>
|
|
134
|
+
))}
|
|
135
|
+
</CardContent>
|
|
136
|
+
</Card>
|
|
137
|
+
)}
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
139
|
+
{/* All Complete */}
|
|
140
|
+
{pendingSteps === 0 && (
|
|
141
|
+
<Card className="border-green-500/50 bg-green-500/5">
|
|
142
|
+
<CardContent className="flex items-center gap-4 p-6">
|
|
143
|
+
<div className="text-4xl">🎉</div>
|
|
144
|
+
<div>
|
|
145
|
+
<h3 className="font-semibold text-green-500 text-lg">
|
|
146
|
+
All Tips Actioned!
|
|
147
|
+
</h3>
|
|
148
|
+
<p className="text-muted-foreground">
|
|
149
|
+
Great job! You've addressed all {totalSteps} coaching tips.
|
|
150
|
+
</p>
|
|
151
|
+
</div>
|
|
152
|
+
</CardContent>
|
|
153
|
+
</Card>
|
|
154
|
+
)}
|
|
155
|
+
</div>
|
|
156
|
+
);
|
|
157
157
|
}
|