import React from 'react' import learnhouseAI_icon from "public/learnhouse_ai_simple.png"; import { motion, AnimatePresence } from 'framer-motion'; import Image from 'next/image'; import { BetweenHorizontalStart, FastForward, Feather, FileStack, HelpCircle, Languages, MessageCircle, MoreVertical, Pen, X } from 'lucide-react'; import { Editor } from '@tiptap/react'; import { AIChatBotStateTypes, useAIChatBot, useAIChatBotDispatch } from '@components/Contexts/AI/AIChatBotContext'; import { AIEditorStateTypes, useAIEditor, useAIEditorDispatch } from '@components/Contexts/AI/AIEditorContext'; import { sendActivityAIChatMessage, startActivityAIChatSession } from '@services/ai/ai'; import useGetAIFeatures from '@components/AI/Hooks/useGetAIFeatures'; type AIEditorToolkitProps = { editor: Editor, activity: any } type AIPromptsLabels = { label: 'Writer' | 'ContinueWriting' | 'MakeLonger' | 'GenerateQuiz' | 'Translate', selection: string } function AIEditorToolkit(props: AIEditorToolkitProps) { const dispatchAIEditor = useAIEditorDispatch() as any; const aiEditorState = useAIEditor() as AIEditorStateTypes; const is_ai_feature_enabled = useGetAIFeatures({ feature: 'editor' }); const [isToolkitAvailable, setIsToolkitAvailable] = React.useState(true); React.useEffect(() => { if (is_ai_feature_enabled) { setIsToolkitAvailable(true); } }, [is_ai_feature_enabled]) return ( <> {isToolkitAvailable &&
Place your cursor at the end of a sentence to continue writing
Select text to make longer
Translate selected text to
Thinking...