mirror of
https://github.com/artegoser/AnoPaper.git
synced 2024-11-24 21:06:21 +03:00
fix: ai completion
This commit is contained in:
parent
0a0f0f950a
commit
b8c7c69012
2 changed files with 12 additions and 9 deletions
|
@ -140,6 +140,7 @@ function NoteTextArea({ value, onChange, preview = false }) {
|
||||||
maxLength={5000}
|
maxLength={5000}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
defaultValue={value}
|
defaultValue={value}
|
||||||
|
id="noteTextArea"
|
||||||
></textarea>
|
></textarea>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -159,8 +160,9 @@ function NotesAdditionalSettings({
|
||||||
text={locals.AIComplete}
|
text={locals.AIComplete}
|
||||||
className="m-1"
|
className="m-1"
|
||||||
w="w-full"
|
w="w-full"
|
||||||
onClick={() => {
|
onClick={async () => {
|
||||||
let text = Complete(noteText);
|
let text = await Complete(noteText);
|
||||||
|
document.getElementById("noteTextArea").value = text;
|
||||||
|
|
||||||
onClick(text);
|
onClick(text);
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -58,13 +58,14 @@ function NotePage() {
|
||||||
value={note.text}
|
value={note.text}
|
||||||
onChange={(e) => (note.text = e.target.value)}
|
onChange={(e) => (note.text = e.target.value)}
|
||||||
/>
|
/>
|
||||||
|
<div className="grid grid-cols-1 lg:grid-cols-2 justify-items-center w-full">
|
||||||
<NotesAdditionalSettings
|
<NotesAdditionalSettings
|
||||||
noteText={note.text}
|
noteText={note.text}
|
||||||
onClick={(text) => {
|
onClick={(text) => {
|
||||||
note.text = text;
|
note.text = text;
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<Note note={note} />
|
<Note note={note} />
|
||||||
|
|
Loading…
Add table
Reference in a new issue