diff --git a/apps/web/app/new/page.tsx b/apps/web/app/new/page.tsx index 2758ff0d..1f9b56be 100644 --- a/apps/web/app/new/page.tsx +++ b/apps/web/app/new/page.tsx @@ -1,29 +1,45 @@ "use client" +import { useState } from "react" import { Header } from "@/components/new/header" import { ChatSidebar } from "@/components/new/chat" import { AnimatePresence } from "motion/react" import { MemoriesGrid } from "@/components/new/memories-grid" import { AnimatedGradientBackground } from "@/components/new/animated-gradient-background" +import { AddDocumentModal } from "@/components/new/add-document" +import { HotkeysProvider } from "react-hotkeys-hook" +import { useHotkeys } from "react-hotkeys-hook" export default function NewPage() { - return ( -
- -
-
-
-
-
- -
+ const [isAddDocumentOpen, setIsAddDocumentOpen] = useState(false) + useHotkeys("c", () => setIsAddDocumentOpen(true)) - - - + return ( + +
+ +
setIsAddDocumentOpen(true)} /> +
+
+
+
+ +
+ + + + +
-
-
-
+ + setIsAddDocumentOpen(false)} + /> + + ) } diff --git a/apps/web/components/new/add-document/connections.tsx b/apps/web/components/new/add-document/connections.tsx new file mode 100644 index 00000000..1f2f53db --- /dev/null +++ b/apps/web/components/new/add-document/connections.tsx @@ -0,0 +1,98 @@ +import { dmSansClassName } from "@/utils/fonts" +import { cn } from "@lib/utils" +import { GoogleDrive, Notion, OneDrive } from "@ui/assets/icons" +import { Check, Zap } from "lucide-react" + +export function ConnectContent() { + const isProUser = true + return ( +
+
+

Supermemory Connections

+ + PRO + +
+
+
+ +
+

Google Drive

+

+ Connect your Google docs, sheets and slides +

+
+
+
+ +
+

Notion

+

+ Import your Notion pages and databases +

+
+
+
+ +
+

OneDrive

+

+ Access your Microsoft Office documents +

+
+
+
+
+ + {!isProUser ? ( + <> +

+ + Upgrade to Pro + {" "} + to get +
+ Supermemory Connections +

+
+
+ + Unlimited memories +
+
+ + 10 connections +
+
+ + Advanced search +
+
+ + Priority support +
+
+ + ) : ( +
+

No connections yet

+

+ Choose a service above to import your knowledge +

+
+ )} +
+
+ ) +} diff --git a/apps/web/components/new/add-document/file.tsx b/apps/web/components/new/add-document/file.tsx new file mode 100644 index 00000000..ff4578c2 --- /dev/null +++ b/apps/web/components/new/add-document/file.tsx @@ -0,0 +1,96 @@ +import { useState } from "react" +import { cn } from "@lib/utils" +import { dmSansClassName } from "@/utils/fonts" +import { FileIcon } from "lucide-react" + +export function FileContent() { + const [isDragging, setIsDragging] = useState(false) + const [selectedFile, setSelectedFile] = useState(null) + + const handleDragOver = (e: React.DragEvent) => { + e.preventDefault() + setIsDragging(true) + } + + const handleDragLeave = (e: React.DragEvent) => { + e.preventDefault() + setIsDragging(false) + } + + const handleDrop = (e: React.DragEvent) => { + e.preventDefault() + setIsDragging(false) + const file = e.dataTransfer.files[0] + if (file) { + setSelectedFile(file) + } + } + + const handleFileSelect = (e: React.ChangeEvent) => { + const file = e.target.files?.[0] + if (file) { + setSelectedFile(file) + } + } + + return ( +
+
+

+ Upload a file (image, pdf, document, sheet) +

+ +
+
+

Title (optional)

+ +
+
+

Description (optional)

+