handleSelection(key)}
- >
-
-
-
+ {TYPES.map(({ key, label, description, icon: Icon }) => {
+ const isAvailable = availableTypes.has(key);
+ return (
+
handleSelection(key)}
+ >
+ {isAvailable && (
+
+ Beschikbaar
+
+ )}
+
-
{label}
+
{description}
-
{description}
-
- ))}
+ );
+ })}
);
diff --git a/src/components/micro_learning/ReflectionPrompt.jsx b/src/components/micro_learning/ReflectionPrompt.jsx
deleted file mode 100644
index af12411..0000000
--- a/src/components/micro_learning/ReflectionPrompt.jsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import React, { useState } from 'react';
-import Card from '../ui/Card';
-import Button from '../ui/Button';
-
-export default function ReflectionPrompt({ content, onComplete }) {
- const [response, setResponse] = useState('');
- const [submitted, setSubmitted] = useState(false);
-
- const handleSubmit = (e) => {
- e.preventDefault();
- if (!response.trim() || submitted) return;
-
- setSubmitted(true);
- onComplete();
- };
-
- return (
-
-
-
Reflection Prompt
-
-
-
-
- {!submitted ? (
-
- ) : (
-
-
-
Your Reflection
-
{response}
-
-
-
-
Model Answer
-
-
{content?.model_answer}
-
-
-
- )}
-
-
- );
-}
diff --git a/src/lib/llmTools.js b/src/lib/llmTools.js
index 7278f27..fddb9a0 100644
--- a/src/lib/llmTools.js
+++ b/src/lib/llmTools.js
@@ -418,15 +418,3 @@ export const EMIT_FLASHCARD_SET_TOOL = {
},
};
-export const EMIT_REFLECTION_PROMPT_TOOL = {
- name: 'emit_reflection_prompt',
- description: 'Return an open-ended reflection question that asks the employee to connect the topic to their own professional experience, plus a model answer showing the expected depth and specificity.',
- input_schema: {
- type: 'object',
- properties: {
- prompt: { type: 'string', description: 'An open-ended question that cannot be answered with a fact. It must require the employee to think about their own context.' },
- model_answer: { type: 'string', description: 'An example of a thoughtful, specific response (3–5 sentences). This is not a rubric — it illustrates depth.' },
- },
- required: ['prompt', 'model_answer'],
- },
-};
diff --git a/src/lib/microLearningService.js b/src/lib/microLearningService.js
index d76e522..5c30588 100644
--- a/src/lib/microLearningService.js
+++ b/src/lib/microLearningService.js
@@ -15,7 +15,6 @@ import {
EMIT_CONCEPT_EXPLAINER_TOOL,
EMIT_SCENARIO_QUIZ_TOOL,
EMIT_FLASHCARD_SET_TOOL,
- EMIT_REFLECTION_PROMPT_TOOL,
} from './llmTools';
import * as db from './db';
@@ -53,15 +52,6 @@ Mix three question types:
- Relationships: "How does X relate to Y?"
Keep answers concise — one or two sentences maximum.`,
},
- reflection_prompt: {
- tool: EMIT_REFLECTION_PROMPT_TOOL,
- tier: 'fast',
- maxTokens: 1024,
- instructions: `Generate a reflection prompt.
-The question must be open-ended and cannot be answered with a fact.
-It must require the employee to think about their own professional context — their team, their role, their past experience.
-The model answer should show depth and specificity (3–5 sentences). It is not a rubric — it is an example of thoughtful reflection.`,
- },
};
const SYSTEM_PROMPT = `You are an expert learning content writer for Respellion, an internal IT company.
@@ -126,6 +116,23 @@ export async function regenerateMicroLearning(topicId, type) {
return getOrGenerateMicroLearning(topicId, type);
}
+/**
+ * Return the set of micro-learning types that already have a published
+ * record for the given topic. Used by the selector UI to flag formats
+ * that are ready to read instantly (no generation latency).
+ */
+export async function getExistingTypesForTopic(topicId) {
+ try {
+ const records = await pb.collection('micro_learnings').getFullList({
+ filter: `topic_id = "${topicId}" && status = "published"`,
+ fields: 'type',
+ });
+ return new Set(records.map((r) => r.type));
+ } catch {
+ return new Set();
+ }
+}
+
/**
* Delete all cached micro learnings for a topic (all types).
*/