+
+
+
+
Browser Sessions
+ ({allSessions.length})
+
+
+
+
+
+
{/* Search */}
-
+
setSearch(e.target.value)}
- placeholder="Search sessions..."
- className="w-full pl-10 pr-4 py-2.5 bg-zinc-900 border border-zinc-800 rounded-xl text-white placeholder-zinc-600 focus:outline-none focus:border-zinc-700 focus:ring-1 focus:ring-zinc-700"
+ value={searchQuery}
+ onChange={(e) => setSearchQuery(e.target.value)}
+ placeholder="Search sessions, tabs, or tags..."
+ className="w-full pl-10 pr-4 py-2.5 bg-white/5 border border-white/10 rounded-xl text-white placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-teal-500"
/>
- {/* Sessions list */}
- {loading ? (
-
Loading sessions...
- ) : sessions.length === 0 ? (
-
- {search ? `No sessions found for "${search}"` : "No sessions yet"}
-
- ) : (
-
- {Object.entries(sessionsByDate).map(([date, dateSessions]) => (
-
- {date}
-
- {dateSessions.map((s) => (
-
- ))}
-
-
- ))}
-
+ {/* Import Modal */}
+ {isImporting && (
+
)}
- {/* Pagination */}
- {pagination.totalPages > 1 && (
-
+ {/* Add Session Form */}
+ {isAdding && (
+
+ )}
+
+ {/* Sessions List */}
+ {sessions.length === 0 ? (
+
+
+
{searchQuery ? `No sessions found for "${searchQuery}"` : "No saved sessions yet"}
+
+ {searchQuery ? "Try a different search term" : "Save your browser tabs to access them anywhere"}
+
+
+ ) : (
+
+ {sessions
+ .sort((a, b) => (b.createdAt || 0) - (a.createdAt || 0))
+ .map((item, index) => {
+ const isExpanded = expandedSessions.has(index)
+ const tabCount = item.tabs?.length || 0
+
+ return (
+
+ {/* Session Header */}
+
toggleExpanded(index)}
+ >
+
+
+
+
{item.name}
+
+ {item.browserType}
+
+
+ {tabCount} tab{tabCount !== 1 ? "s" : ""}
+
+
+ {item.description && (
+
{item.description}
+ )}
+
+
+
+ {formatDate(item.createdAt)}
+
+ {item.tags && item.tags.length > 0 && (
+
+
+ {item.tags.join(", ")}
+
+ )}
+
+
+
+
+
+ {/* Expanded Tabs */}
+ {isExpanded && item.tabs && (
+
+ {item.tabs.map((tab, tabIndex) => (
+
+
+
{tab.title}
+
{tab.url}
+
+
+
+
+
+ ))}
+
+
+
+
+ )}
+
+ )
+ })}
+
)}