From 4a90aaabf3fd41754b990f50ef4cbfa03723b0a8 Mon Sep 17 00:00:00 2001
From: Yash <yashverma30115@gmail.com>
Date: Thu, 11 Apr 2024 02:22:33 +0000
Subject: novel editor

---
 .../web/src/components/Sidebar/AddMemoryDialog.tsx | 31 +++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)

(limited to 'apps/web/src/components/Sidebar/AddMemoryDialog.tsx')

diff --git a/apps/web/src/components/Sidebar/AddMemoryDialog.tsx b/apps/web/src/components/Sidebar/AddMemoryDialog.tsx
index 1bd4b688..5a1d92f0 100644
--- a/apps/web/src/components/Sidebar/AddMemoryDialog.tsx
+++ b/apps/web/src/components/Sidebar/AddMemoryDialog.tsx
@@ -1,4 +1,4 @@
-import { useEffect, useRef } from "react";
+import { Editor } from "novel";
 import {
   DialogClose,
   DialogDescription,
@@ -8,8 +8,9 @@ import {
 } from "../ui/dialog";
 import { Input } from "../ui/input";
 import { Label } from "../ui/label";
+import { useRef } from "react";
 
-export default function AddMemoryPage() {
+export function AddMemoryPage() {
   return (
     <>
       <DialogHeader>
@@ -23,7 +24,7 @@ export default function AddMemoryPage() {
       <Input
         placeholder="Enter the URL of the page"
         type="url"
-        data-autofocus
+        data-modal-autofocus
         className="bg-rgray-4 mt-2 w-full"
       />
       <DialogFooter>
@@ -37,3 +38,27 @@ export default function AddMemoryPage() {
     </>
   );
 }
+
+export function NoteAddPage() {
+  return (
+    <>
+      <Input
+        className="w-full border-none p-0 text-xl ring-0 placeholder:text-white/30 focus-visible:ring-0"
+        placeholder="Name of the note"
+        data-modal-autofocus
+      />
+      <Editor
+        disableLocalStorage
+        className="novel-editor bg-rgray-4 border-rgray-7 dark mt-5 max-h-[60vh] min-h-[40vh] w-[50vw] overflow-y-auto rounded-lg border [&>div>div]:p-5"
+      />
+      <DialogFooter>
+        <DialogClose className="bg-rgray-4 hover:bg-rgray-5 focus-visible:bg-rgray-5 focus-visible:ring-rgray-7 rounded-md px-4 py-2 ring-transparent transition focus-visible:outline-none focus-visible:ring-2">
+          Add
+        </DialogClose>
+        <DialogClose className="hover:bg-rgray-4 focus-visible:bg-rgray-4 focus-visible:ring-rgray-7 rounded-md px-3 py-2 ring-transparent transition focus-visible:outline-none focus-visible:ring-2">
+          Cancel
+        </DialogClose>
+      </DialogFooter>
+    </>
+  );
+}
-- 
cgit v1.2.3

