diff options
| author | Dhravya <[email protected]> | 2024-04-02 18:34:22 -0700 |
|---|---|---|
| committer | Dhravya <[email protected]> | 2024-04-02 18:34:22 -0700 |
| commit | 8664a8ba56257d48a6e666c39dfb3e13a5c76c13 (patch) | |
| tree | 50c64801bfe0c3aa355c07cccbd76e676d92768f /apps/web/src/components | |
| parent | added category support in d1 db, changed schema (diff) | |
| download | supermemory-8664a8ba56257d48a6e666c39dfb3e13a5c76c13.tar.xz supermemory-8664a8ba56257d48a6e666c39dfb3e13a5c76c13.zip | |
fix: fix build fail, add category in storedcontenttypes
Diffstat (limited to 'apps/web/src/components')
| -rw-r--r-- | apps/web/src/components/Sidebar.tsx | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 0644d779..2731e1cd 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -1,42 +1,44 @@ -"use client"; -import { StoredContent } from "@/server/db/schema"; +'use client'; +import { StoredContent } from '@/server/db/schema'; import { Plus, MoreHorizontal, ArrowUpRight, Edit3, Trash2, -} from "lucide-react"; +} from 'lucide-react'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, -} from "./ui/dropdown-menu"; +} from './ui/dropdown-menu'; -import { useState, useEffect, useRef } from "react"; +import { useState, useEffect, useRef } from 'react'; export default function Sidebar() { - const websties: StoredContent[] = [ + const websites: StoredContent[] = [ { id: 1, - content: "", - title: "Visual Studio Code", - url: "https://code.visualstudio.com", - description: "", - image: "https://code.visualstudio.com/favicon.ico", - baseUrl: "https://code.visualstudio.com", + content: '', + title: 'Visual Studio Code', + url: 'https://code.visualstudio.com', + description: '', + image: 'https://code.visualstudio.com/favicon.ico', + baseUrl: 'https://code.visualstudio.com', savedAt: new Date(), + category: 'Development', }, { id: 1, - content: "", + content: '', title: "yxshv/vscode: An unofficial remake of vscode's landing page", - url: "https://github.com/yxshv/vscode", - description: "", - image: "https://github.com/favicon.ico", - baseUrl: "https://github.com", + url: 'https://github.com/yxshv/vscode', + description: '', + image: 'https://github.com/favicon.ico', + baseUrl: 'https://github.com', savedAt: new Date(), + category: 'Development', }, ]; @@ -53,7 +55,7 @@ export default function Sidebar() { <Plus className="h-4 w-4 min-w-4" /> </button> </h1> - {websties.map((item) => ( + {websites.map((item) => ( <ListItem key={item.id} item={item} /> ))} </div> @@ -86,8 +88,8 @@ export const ListItem: React.FC<{ item: StoredContent }> = ({ item }) => { ) : ( <> <img - src={item.image ?? "/brain.png"} - alt={item.title ?? "Untitiled website"} + src={item.image ?? '/brain.png'} + alt={item.title ?? 'Untitiled website'} className="h-4 w-4" /> <ArrowUpRight @@ -102,13 +104,13 @@ export const ListItem: React.FC<{ item: StoredContent }> = ({ item }) => { ref={editInputRef} autoFocus className="text-rgray-12 w-full bg-transparent focus:outline-none" - placeholder={item.title ?? "Untitled website"} + placeholder={item.title ?? 'Untitled website'} onBlur={(e) => setIsEditing(false)} - onKeyDown={(e) => e.key === "Escape" && setIsEditing(false)} + onKeyDown={(e) => e.key === 'Escape' && setIsEditing(false)} /> ) : ( <span className="w-full truncate text-nowrap"> - {item.title ?? "Untitled website"} + {item.title ?? 'Untitled website'} </span> )} </a> |