diff --git a/src/components/Editor/AIEdit.tsx b/src/components/Editor/AIEdit.tsx
new file mode 100644
index 00000000..b55d2eb7
--- /dev/null
+++ b/src/components/Editor/AIEdit.tsx
@@ -0,0 +1,85 @@
+import React from 'react'
+import { useCompletion } from 'ai/react'
+import { ArrowUp, Sparkles, ShrinkIcon, ExpandIcon, Play } from 'lucide-react'
+import { Button } from '@/components/ui/button'
+import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
+
+interface AiEditMenuProps {
+ selectedText: string
+ onEdit: (newText: string) => void
+}
+
+const AiEditMenu = ({ selectedText, onEdit }: AiEditMenuProps) => {
+ const { complete } = useCompletion({
+ api: '/api/generate',
+ })
+
+ const handleAction = async (action: string) => {
+ const prompt = `${action} the following text: ${selectedText}`
+ const completion = await complete(prompt)
+ if (completion) {
+ onEdit(completion)
+ }
+ }
+
+ return (
+
+
+
+
+ Ask AI to edit or generate...
+
+
+
+
+
+
Edit or review selection
+
+
+
+
+
+
+
+
+
Use AI to do more
+
+
+
+
+ )
+}
+
+export default AiEditMenu
diff --git a/src/components/Editor/EditorManager.tsx b/src/components/Editor/EditorManager.tsx
index dc6f0a17..e296761f 100644
--- a/src/components/Editor/EditorManager.tsx
+++ b/src/components/Editor/EditorManager.tsx
@@ -5,6 +5,7 @@ import EditorContextMenu from './EditorContextMenu'
import SearchBar from './Search/SearchBar'
import { useFileContext } from '@/contexts/FileContext'
import DocumentStats from './DocumentStats'
+import AiEditMenu from './AIEdit'
const EditorManager: React.FC = () => {
const [showSearchBar, setShowSearchBar] = useState(false)
@@ -58,7 +59,7 @@ const EditorManager: React.FC = () => {
}}
>
{showAIPopup ? (
-
test hide
+ {}} />
) : (