aboutsummaryrefslogtreecommitdiff
path: root/apps/web/src/components
diff options
context:
space:
mode:
authorDhravya <[email protected]>2024-04-13 11:40:01 -0700
committerDhravya <[email protected]>2024-04-13 11:40:01 -0700
commit6f4792cab8643dacd651c3cb1b069ad7aedd33fb (patch)
tree88f03e31212bbf8b3ebff55f0ca93d2dff4e190f /apps/web/src/components
parentadded browser rendering for getting clean page content (diff)
parentfix notes (diff)
downloadsupermemory-6f4792cab8643dacd651c3cb1b069ad7aedd33fb.tar.xz
supermemory-6f4792cab8643dacd651c3cb1b069ad7aedd33fb.zip
resolved conflicts
Diffstat (limited to 'apps/web/src/components')
-rw-r--r--apps/web/src/components/Sidebar/AddMemoryDialog.tsx12
-rw-r--r--apps/web/src/components/Sidebar/FilterCombobox.tsx7
-rw-r--r--apps/web/src/components/Sidebar/MemoriesBar.tsx22
3 files changed, 31 insertions, 10 deletions
diff --git a/apps/web/src/components/Sidebar/AddMemoryDialog.tsx b/apps/web/src/components/Sidebar/AddMemoryDialog.tsx
index 3043c972..31628ab7 100644
--- a/apps/web/src/components/Sidebar/AddMemoryDialog.tsx
+++ b/apps/web/src/components/Sidebar/AddMemoryDialog.tsx
@@ -324,12 +324,18 @@ export function MemorySelectedItem({
id,
title,
url,
+ type,
image,
onRemove,
}: StoredContent & { onRemove: () => void }) {
return (
<div className="hover:bg-rgray-4 focus-within-bg-rgray-4 flex w-full items-center justify-start gap-2 rounded-md p-1 px-2 text-sm [&:hover>[data-icon]]:block [&:hover>img]:hidden">
- <img src={image ?? "/icons/logo_without_bg.png"} className="h-5 w-5" />
+ <img
+ src={
+ type === "note" ? "/note.svg" : image ?? "/icons/logo_without_bg.png"
+ }
+ className="h-5 w-5"
+ />
<button
onClick={onRemove}
data-icon
@@ -338,7 +344,9 @@ export function MemorySelectedItem({
<X className="h-5 w-5 scale-90" />
</button>
<span>{title}</span>
- <span className="ml-auto block opacity-50">{cleanUrl(url)}</span>
+ <span className="ml-auto block opacity-50">
+ {type === "note" ? "Note" : cleanUrl(url)}
+ </span>
</div>
);
}
diff --git a/apps/web/src/components/Sidebar/FilterCombobox.tsx b/apps/web/src/components/Sidebar/FilterCombobox.tsx
index 80319ab1..c2c68135 100644
--- a/apps/web/src/components/Sidebar/FilterCombobox.tsx
+++ b/apps/web/src/components/Sidebar/FilterCombobox.tsx
@@ -180,7 +180,6 @@ export function FilterMemories({
const [isSearching, setIsSearching] = React.useState(false);
const results = React.useMemo(() => {
- console.log("use memo");
return searchResults.map((r) => r.memory);
}, [searchResults]);
@@ -266,7 +265,11 @@ export function FilterMemories({
>
<div className="text-rgray-11">
<img
- src={m.image ?? "/icons/logo_without_bg.png"}
+ src={
+ m.type === "note"
+ ? "/note.svg"
+ : m.image ?? "/icons/logo_without_bg.png"
+ }
className="mr-2 h-4 w-4"
/>
{m.title}
diff --git a/apps/web/src/components/Sidebar/MemoriesBar.tsx b/apps/web/src/components/Sidebar/MemoriesBar.tsx
index 0c468475..052098db 100644
--- a/apps/web/src/components/Sidebar/MemoriesBar.tsx
+++ b/apps/web/src/components/Sidebar/MemoriesBar.tsx
@@ -46,7 +46,6 @@ import { ExpandedSpace } from "./ExpandedSpace";
import { StoredContent, StoredSpace } from "@/server/db/schema";
import Image from "next/image";
import { useDebounce } from "@/hooks/useDebounce";
-import { searchMemoriesAndSpaces } from "@/actions/db";
export function MemoriesBar() {
const [parent, enableAnimations] = useAutoAnimate();
@@ -169,7 +168,7 @@ export function MemoriesBar() {
<>
{spaces.map((space) => (
<SpaceItem
- onDelete={() => {}}
+ onDelete={() => deleteSpace(space.id)}
key={space.id}
//onClick={() => setExpandedSpace(space.id)}
{...space}
@@ -255,7 +254,6 @@ export function SpaceItem({
}, [cachedMemories]);
const _name = name.length > 10 ? name.slice(0, 10) + "..." : name;
-
return (
<motion.div
ref={itemRef}
@@ -355,19 +353,31 @@ export function SpaceItem({
<MemoryWithImages3
className="h-24 w-24"
id={id.toString()}
- images={spaceMemories.map((c) => c.image).reverse() as string[]}
+ images={
+ spaceMemories
+ .map((c) => (c.type === "note" ? "/note.svg" : c.image))
+ .reverse() as string[]
+ }
/>
) : spaceMemories.length > 1 ? (
<MemoryWithImages2
className="h-24 w-24"
id={id.toString()}
- images={spaceMemories.map((c) => c.image).reverse() as string[]}
+ images={
+ spaceMemories
+ .map((c) => (c.type === "note" ? "/note.svg" : c.image))
+ .reverse() as string[]
+ }
/>
) : spaceMemories.length === 1 ? (
<MemoryWithImage
className="h-24 w-24"
id={id.toString()}
- image={spaceMemories[0].image!}
+ image={
+ spaceMemories[0].type === "note"
+ ? "/note.svg"
+ : spaceMemories[0].image!
+ }
/>
) : (
<div className="bg-rgray-4 shadow- h-24 w-24 scale-50 rounded-full opacity-30"></div>