-
+
+
+
+
+
+ handleProjectSelect(DEFAULT_PROJECT_ID)}
+ className={cn(
+ "flex items-center gap-2 px-3 py-2 rounded-[8px] cursor-pointer",
+ localSelectedProject === DEFAULT_PROJECT_ID
+ ? "bg-[#4BA0FA]/20 text-white"
+ : "text-[#737373] hover:bg-[#14161A] hover:text-white",
+ )}
+ >
+
+ Default Project
+
+ {projects
+ .filter((p: Project) => p.containerTag !== DEFAULT_PROJECT_ID)
+ .map((project: Project) => (
+ handleProjectSelect(project.containerTag)}
+ className={cn(
+ "flex items-center gap-2 px-3 py-2 rounded-[8px] cursor-pointer",
+ localSelectedProject === project.containerTag
+ ? "bg-[#4BA0FA]/20 text-white"
+ : "text-[#737373] hover:bg-[#14161A] hover:text-white",
+ )}
+ >
+
+
+ {project.name}
+
+
+ ))}
+
+
{activeTab !== "connect" && (
-
@@ -181,7 +438,7 @@ function TabButton({
type="button"
onClick={onClick}
className={cn(
- "flex items-start gap-3 p-4 rounded-[16px] text-left transition-colors w-full",
+ "flex items-start gap-3 p-4 rounded-[16px] text-left transition-colors w-full focus:outline-none focus:ring-0",
active
? "bg-[#14161A] shadow-inside-out"
: "hover:bg-[#14161A]/50 hover:shadow-[inset_0_2px_4px_rgba(0,0,0,0.3),inset_0_1px_2px_rgba(0,0,0,0.1)]",
diff --git a/apps/web/components/new/add-document/link.tsx b/apps/web/components/new/add-document/link.tsx
index 2c3e32f6..0c50d194 100644
--- a/apps/web/components/new/add-document/link.tsx
+++ b/apps/web/components/new/add-document/link.tsx
@@ -1,8 +1,71 @@
+"use client"
+
+import { useState, useEffect } from "react"
import { cn } from "@lib/utils"
import { Button } from "@ui/components/button"
import { dmSansClassName } from "@/utils/fonts"
+import { useHotkeys } from "react-hotkeys-hook"
+
+export interface LinkData {
+ url: string
+ title: string
+ description: string
+}
+
+interface LinkContentProps {
+ onSubmit?: (data: LinkData) => void
+ onDataChange?: (data: LinkData) => void
+ isSubmitting?: boolean
+ isOpen?: boolean
+}
+
+export function LinkContent({ onSubmit, onDataChange, isSubmitting, isOpen }: LinkContentProps) {
+ const [url, setUrl] = useState("")
+ const [title, setTitle] = useState("")
+ const [description, setDescription] = useState("")
+
+ const canSubmit = url.trim().length > 0 && !isSubmitting
+
+ const handleSubmit = () => {
+ if (canSubmit && onSubmit) {
+ onSubmit({ url, title, description })
+ }
+ }
+
+ const updateData = (newUrl: string, newTitle: string, newDescription: string) => {
+ onDataChange?.({ url: newUrl, title: newTitle, description: newDescription })
+ }
+
+ const handleUrlChange = (newUrl: string) => {
+ setUrl(newUrl)
+ updateData(newUrl, title, description)
+ }
+
+ const handleTitleChange = (newTitle: string) => {
+ setTitle(newTitle)
+ updateData(url, newTitle, description)
+ }
+
+ const handleDescriptionChange = (newDescription: string) => {
+ setDescription(newDescription)
+ updateData(url, title, newDescription)
+ }
+
+ useHotkeys("mod+enter", handleSubmit, {
+ enabled: isOpen && canSubmit,
+ enableOnFormTags: ["INPUT", "TEXTAREA"],
+ })
+
+ // Reset content when modal closes
+ useEffect(() => {
+ if (!isOpen) {
+ setUrl("")
+ setTitle("")
+ setDescription("")
+ onDataChange?.({ url: "", title: "", description: "" })
+ }
+ }, [isOpen, onDataChange])
-export function LinkContent() {
return (
@@ -40,8 +109,11 @@ export function LinkContent() {
Link description
@@ -49,7 +121,7 @@ export function LinkContent() {
Link Preview
-
Portfolio website of Mahesh Sanikommu
+
{description || "Portfolio website of Mahesh Sanikommu"}
diff --git a/apps/web/components/new/add-document/note.tsx b/apps/web/components/new/add-document/note.tsx
index 47c45aa3..c7c2a2ac 100644
--- a/apps/web/components/new/add-document/note.tsx
+++ b/apps/web/components/new/add-document/note.tsx
@@ -1,8 +1,51 @@
-export function NoteContent() {
+"use client"
+
+import { useState, useEffect } from "react"
+import { useHotkeys } from "react-hotkeys-hook"
+
+interface NoteContentProps {
+ onSubmit?: (content: string) => void
+ onContentChange?: (content: string) => void
+ isSubmitting?: boolean
+ isOpen?: boolean
+}
+
+export function NoteContent({ onSubmit, onContentChange, isSubmitting, isOpen }: NoteContentProps) {
+ const [content, setContent] = useState("")
+
+ const canSubmit = content.trim().length > 0 && !isSubmitting
+
+ const handleSubmit = () => {
+ if (canSubmit && onSubmit) {
+ onSubmit(content)
+ }
+ }
+
+ const handleContentChange = (newContent: string) => {
+ setContent(newContent)
+ onContentChange?.(newContent)
+ }
+
+ useHotkeys("mod+enter", handleSubmit, {
+ enabled: isOpen && canSubmit,
+ enableOnFormTags: ["TEXTAREA"],
+ })
+
+ // Reset content when modal closes
+ useEffect(() => {
+ if (!isOpen) {
+ setContent("")
+ onContentChange?.("")
+ }
+ }, [isOpen, onContentChange])
+
return (