Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions frontend/src/components/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,24 @@ function EditorCanvas({
handleDragOver,
handleDragLeave,
handleEditorClick
}) {
})
async function checkGrammar(text) {
const response = await fetch(
'https://api.languagetoolplus.com/v2/check',
{
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
text,
language: 'en-US'
})
}
);
const data = await response.json();
// Parse and display highlights or suggestions
// Show errors and corrections
}
{
return (
<div className="editor-body">
<aside className="editor-sidebar">
Expand All @@ -37,7 +54,8 @@ function EditorCanvas({
ref={editorRef}
className="editor-page"
data-page-size={pageSize}
contentEditable
contentEditable={true}
spellCheck={true}
suppressContentEditableWarning
onInput={handleInput}
onFocus={handleFocus}
Expand Down