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 { AlertTriangle, BetweenHorizontalStart, FastForward, Feather, FileStack, HelpCircle, Languages, MoreVertical, X, } from 'lucide-react' import { Editor } from '@tiptap/react' import { AIEditorStateTypes, useAIEditor, useAIEditorDispatch, } from '@components/Contexts/AI/AIEditorContext' import { sendActivityAIChatMessage, startActivityAIChatSession, } from '@services/ai/ai' import useGetAIFeatures from '@components/Hooks/useGetAIFeatures' import { useLHSession } from '@components/Contexts/LHSessionContext' 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...