@@ -31,6 +31,7 @@ import { HighlightsCard, type HighlightItem } from "./highlights-card"
3131import { GraphCard } from "./memory-graph"
3232import { Button } from "@ui/components/button"
3333import { categoriesParam } from "@/lib/search-params"
34+ import { NovaEmptyState } from "@/components/nova/nova-empty-state"
3435import {
3536 AlertDialog ,
3637 AlertDialogAction ,
@@ -92,6 +93,15 @@ interface HighlightsProps {
9293 isLoading : boolean
9394}
9495
96+ interface NovaEmptyStateProps {
97+ onAddMemory : ( tab : "note" | "link" ) => void
98+ onOpenIntegrations : (
99+ integration ?: "import" | "chrome" | "connections" ,
100+ ) => void
101+ isAllSpaces : boolean
102+ spaceName ?: string
103+ }
104+
95105interface MemoriesGridProps {
96106 isChatOpen : boolean
97107 onOpenDocument : ( document : DocumentWithMemories ) => void
@@ -105,6 +115,7 @@ interface MemoriesGridProps {
105115 isBulkDeleting ?: boolean
106116 quickNoteProps ?: QuickNoteProps
107117 highlightsProps ?: HighlightsProps
118+ emptyStateProps ?: NovaEmptyStateProps
108119}
109120
110121export function MemoriesGrid ( {
@@ -120,6 +131,7 @@ export function MemoriesGrid({
120131 isBulkDeleting = false ,
121132 quickNoteProps,
122133 highlightsProps,
134+ emptyStateProps,
123135} : MemoriesGridProps ) {
124136 const [ showBulkDeleteConfirm , setShowBulkDeleteConfirm ] = useState ( false )
125137 const { user } = useAuth ( )
@@ -340,99 +352,107 @@ export function MemoriesGrid({
340352 )
341353 }
342354
355+ const isEmpty = documents . length === 0 && ! isPending
356+ const showNovaEmptyState = isEmpty && emptyStateProps
357+
343358 return (
344359 < div className = "relative" >
345- < div
346- id = "filter-pills"
347- className = "flex items-center justify-between gap-4 mb-3"
348- >
349- < div className = "flex flex-wrap items-center gap-1.5" >
350- < Button
351- className = { cn (
352- dmSansClassName ( ) ,
353- "rounded-full border border-[#161F2C] bg-[#0D121A] px-2.5 py-1 text-xs h-auto hover:bg-[#00173C] hover:border-[#2261CA33]" ,
354- selectedCategories . length === 0 &&
355- "bg-[#00173C] border-[#2261CA33]" ,
356- ) }
357- onClick = { handleSelectAll }
358- >
359- All
360- { facetsData ?. total !== undefined && (
361- < span className = "ml-1 text-[#737373]" > ({ facetsData . total } )</ span >
362- ) }
363- </ Button >
364- { facetsData ?. facets . map ( ( facet : DocumentFacet ) => (
360+ { ! isEmpty && (
361+ < div
362+ id = "filter-pills"
363+ className = "flex items-center justify-between gap-4 mb-3"
364+ >
365+ < div className = "flex flex-wrap items-center gap-1.5" >
365366 < Button
366- key = { facet . category }
367367 className = { cn (
368368 dmSansClassName ( ) ,
369369 "rounded-full border border-[#161F2C] bg-[#0D121A] px-2.5 py-1 text-xs h-auto hover:bg-[#00173C] hover:border-[#2261CA33]" ,
370- selectedCategories . includes ( facet . category ) &&
370+ selectedCategories . length === 0 &&
371371 "bg-[#00173C] border-[#2261CA33]" ,
372372 ) }
373- onClick = { ( ) => handleCategoryToggle ( facet . category ) }
373+ onClick = { handleSelectAll }
374374 >
375- { facet . label }
376- < span className = "ml-1 text-[#737373]" > ({ facet . count } )</ span >
375+ All
376+ { facetsData ?. total !== undefined && (
377+ < span className = "ml-1 text-[#737373]" >
378+ ({ facetsData . total } )
379+ </ span >
380+ ) }
377381 </ Button >
378- ) ) }
379- </ div >
380-
381- < div className = "flex items-center gap-2 shrink-0" >
382- { isSelectionMode && (
383- < >
382+ { facetsData ?. facets . map ( ( facet : DocumentFacet ) => (
383+ < Button
384+ key = { facet . category }
385+ className = { cn (
386+ dmSansClassName ( ) ,
387+ "rounded-full border border-[#161F2C] bg-[#0D121A] px-2.5 py-1 text-xs h-auto hover:bg-[#00173C] hover:border-[#2261CA33]" ,
388+ selectedCategories . includes ( facet . category ) &&
389+ "bg-[#00173C] border-[#2261CA33]" ,
390+ ) }
391+ onClick = { ( ) => handleCategoryToggle ( facet . category ) }
392+ >
393+ { facet . label }
394+ < span className = "ml-1 text-[#737373]" > ({ facet . count } )</ span >
395+ </ Button >
396+ ) ) }
397+ </ div >
398+ < div className = "flex items-center gap-2 shrink-0" >
399+ { isSelectionMode && (
400+ < >
401+ < button
402+ type = "button"
403+ aria-label = "Exit selection mode"
404+ className = "w-8 h-8 flex items-center justify-center rounded-full border border-[#161F2C] bg-[#0D121A] hover:bg-[#00173C] transition-colors cursor-pointer"
405+ onClick = { onClearSelection }
406+ >
407+ < XIcon className = "w-4 h-4 text-[#737373]" />
408+ </ button >
409+ { selectedDocumentIds . size > 0 ? (
410+ < >
411+ < button
412+ type = "button"
413+ className = { cn (
414+ dmSansClassName ( ) ,
415+ "text-xs text-[#737373] hover:text-white transition-colors cursor-pointer" ,
416+ ) }
417+ onClick = { handleSelectAllVisible }
418+ >
419+ Select all
420+ </ button >
421+ < button
422+ type = "button"
423+ className = { cn (
424+ dmSansClassName ( ) ,
425+ "flex items-center gap-1 text-xs text-red-400 hover:text-red-300 transition-colors cursor-pointer disabled:opacity-50" ,
426+ ) }
427+ onClick = { handleBulkDeleteClick }
428+ disabled = { isBulkDeleting }
429+ >
430+ < Trash2Icon className = "w-3 h-3" />
431+ Delete ({ selectedDocumentIds . size } )
432+ </ button >
433+ </ >
434+ ) : (
435+ < p
436+ className = { cn ( dmSansClassName ( ) , "text-xs text-[#737373]" ) }
437+ >
438+ Select one or more documents
439+ </ p >
440+ ) }
441+ </ >
442+ ) }
443+ { ! isSelectionMode && onEnterSelectionMode && (
384444 < button
385445 type = "button"
386- aria-label = "Exit selection mode"
446+ aria-label = "Enter selection mode"
387447 className = "w-8 h-8 flex items-center justify-center rounded-full border border-[#161F2C] bg-[#0D121A] hover:bg-[#00173C] transition-colors cursor-pointer"
388- onClick = { onClearSelection }
448+ onClick = { onEnterSelectionMode }
389449 >
390- < XIcon className = "w-4 h-4 text -[#737373]" />
450+ < div className = "w-3 h-3 rounded-[2.25px] border border -[#737373]" />
391451 </ button >
392- { selectedDocumentIds . size > 0 ? (
393- < >
394- < button
395- type = "button"
396- className = { cn (
397- dmSansClassName ( ) ,
398- "text-xs text-[#737373] hover:text-white transition-colors cursor-pointer" ,
399- ) }
400- onClick = { handleSelectAllVisible }
401- >
402- Select all
403- </ button >
404- < button
405- type = "button"
406- className = { cn (
407- dmSansClassName ( ) ,
408- "flex items-center gap-1 text-xs text-red-400 hover:text-red-300 transition-colors cursor-pointer disabled:opacity-50" ,
409- ) }
410- onClick = { handleBulkDeleteClick }
411- disabled = { isBulkDeleting }
412- >
413- < Trash2Icon className = "w-3 h-3" />
414- Delete ({ selectedDocumentIds . size } )
415- </ button >
416- </ >
417- ) : (
418- < p className = { cn ( dmSansClassName ( ) , "text-xs text-[#737373]" ) } >
419- Select one or more documents
420- </ p >
421- ) }
422- </ >
423- ) }
424- { ! isSelectionMode && onEnterSelectionMode && (
425- < button
426- type = "button"
427- aria-label = "Enter selection mode"
428- className = "w-8 h-8 flex items-center justify-center rounded-full border border-[#161F2C] bg-[#0D121A] hover:bg-[#00173C] transition-colors cursor-pointer"
429- onClick = { onEnterSelectionMode }
430- >
431- < div className = "w-3 h-3 rounded-[2.25px] border border-[#737373]" />
432- </ button >
433- ) }
452+ ) }
453+ </ div >
434454 </ div >
435- </ div >
455+ ) }
436456
437457 < AlertDialog
438458 open = { showBulkDeleteConfirm }
@@ -486,7 +506,14 @@ export function MemoriesGrid({
486506 < div className = "h-full flex items-center justify-center p-4" >
487507 < SuperLoader />
488508 </ div >
489- ) : documents . length === 0 && ! isPending ? (
509+ ) : showNovaEmptyState ? (
510+ < NovaEmptyState
511+ onAddMemory = { emptyStateProps . onAddMemory }
512+ onOpenIntegrations = { emptyStateProps . onOpenIntegrations }
513+ isAllSpaces = { emptyStateProps . isAllSpaces }
514+ spaceName = { emptyStateProps . spaceName }
515+ />
516+ ) : isEmpty ? (
490517 < div className = "h-full flex items-center justify-center p-4" >
491518 < div className = "text-center text-muted-foreground" >
492519 No memories found
0 commit comments