Skip to content

Commit

Permalink
constraints working
Browse files Browse the repository at this point in the history
  • Loading branch information
samlhuillier committed Nov 14, 2024
1 parent a84c70e commit 94320ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/components/Editor/AIEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const AiEditMenu = ({ selectedText, onEdit }: AiEditMenuProps) => {
<div className="relative rounded-md border border-border bg-background/95 p-3 text-sm text-foreground shadow-lg backdrop-blur">
{isLoading && !response && <div className="animate-pulse text-muted-foreground">Generating response...</div>}
{response && (
<div className="prose prose-invert max-w-none">
<p className="m-0">{response}</p>
<div className="prose prose-invert max-h-[400px] max-w-none overflow-y-auto">
<p className="m-0 text-sm">{response}</p>
</div>
)}
</div>
Expand Down
13 changes: 5 additions & 8 deletions src/components/Editor/EditorManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ const EditorManager: React.FC = () => {
onHidden: () => {
setShowAIPopup(false)
},
maxWidth: 'none',
}}
>
<div
className="w-[300px]"
onMouseDown={(e) => {
e.preventDefault()
e.stopPropagation()
Expand All @@ -72,17 +74,12 @@ const EditorManager: React.FC = () => {
}}
>
{showAIPopup ? (
// <input
// type="text"
// onClick={(e) => e.stopPropagation()}
// onMouseDown={(e) => e.stopPropagation()}
// onKeyDown={(e) => e.stopPropagation()}
// className="bg-dark-gray-c-twelve rounded border border-gray-700 px-2 py-1 focus:outline-none focus:ring-1 focus:ring-blue-500"
// />
// <div className="max-h-[400px] overflow-y-auto">
<AiEditMenu selectedText={editor.getText()} onEdit={() => {}} />
) : (
// </div>
<button onClick={() => setShowAIPopup(true)} className="rounded p-2 hover:bg-gray-700">
AI Edit{' '}
AI Edit
</button>
)}
</div>
Expand Down

0 comments on commit 94320ca

Please sign in to comment.