'use client'; import React from 'react'; import type { CopilotPluginConfig } from '@udecode/plate-ai/react'; import { useEditorPlugin, useElement } from '@udecode/plate-common/react'; export const GhostText = () => { const { useOption } = useEditorPlugin({ key: 'copilot', }); const element = useElement(); const isSuggested = useOption('isSuggested', element.id as string); if (!isSuggested) return null; return ; }; export function GhostTextContent() { const { useOption } = useEditorPlugin({ key: 'copilot', }); const suggestionText = useOption('suggestionText'); return ( {suggestionText && suggestionText} ); }