@@ -93,7 +130,46 @@
bind:value={$lesson.materials.note}
placeholder="Start typing your lesson"
onInputChange={() => ($isLessonDirty = true)}
- />
+ bind:textareaRef
+ bind:buttonRef={aiButtonRef}
+ >
+
+
{
+ openPopover = !openPopover;
+ }}
+ isLoading={$isLoading}
+ isDisabled={$isLoading}
+ >
+
+ AI Assistant
+ {
+ openPopover = aiButtonRef?.contains(detail.target);
+ }}
+ >
+
+
+
+
+
+
+
+
+
{:else if $lesson.materials.note}
{:else}
diff --git a/src/lib/components/EditContent/index.svelte b/src/lib/components/EditContent/index.svelte
index b8384495..2a3dfe88 100644
--- a/src/lib/components/EditContent/index.svelte
+++ b/src/lib/components/EditContent/index.svelte
@@ -7,6 +7,8 @@
export let placeholder = ``;
export let onInputChange = () => {};
export let textAreaHeight = '';
+ export let textareaRef;
+ export let buttonRef;
const activeClassName = 'border-b-2 border-blue-700';
const handleTabClick = (tab) => () => {
@@ -28,11 +30,19 @@
>
Preview
+
+ {#if $$slots.buttons}
+
+
+
+
+ {/if}
{#if isWriteMode}