-
-
{t("all_chats") || "All Chats"}
-
-
-
- {/* Search Input */}
-
-
- setSearchQuery(e.target.value)}
- className="pl-9 pr-8 h-9"
- />
- {searchQuery && (
-
- )}
-
-
-
- {/* Tab toggle for active/archived (only show when not searching) */}
- {!isSearchMode && (
-
- {isLoading ? (
-
-
-
- ) : error ? (
-
- {t("error_loading_chats") || "Error loading chats"}
-
- ) : threads.length > 0 ? (
-
- {threads.map((thread) => {
- const isDeleting = deletingThreadId === thread.id;
- const isArchiving = archivingThreadId === thread.id;
- const isBusy = isDeleting || isArchiving;
- const isActive = currentChatId === thread.id;
-
- return (
-
- {/* Main clickable area for navigation */}
-
-
-
-
-
-
- {t("updated") || "Updated"}:{" "}
- {format(new Date(thread.updatedAt), "MMM d, yyyy 'at' h:mm a")}
-
-
-
-
- {/* Actions dropdown */}
-
setOpenDropdownId(isOpen ? thread.id : null)}
- >
-
-
-
-
- handleToggleArchive(thread.id, thread.archived)}
- disabled={isArchiving}
- >
- {thread.archived ? (
- <>
-
- {t("unarchive") || "Restore"}
- >
- ) : (
- <>
-
- {t("archive") || "Archive"}
- >
- )}
-
-
- handleDeleteThread(thread.id)}
- className="text-destructive focus:text-destructive"
- >
-
- {t("delete") || "Delete"}
-
-
-
-
- );
- })}
-
- ) : isSearchMode ? (
-
-
-
- {t("no_chats_found") || "No chats found"}
-
-
- {t("try_different_search") || "Try a different search term"}
-
-
- ) : (
-
-
-
- {showArchived
- ? t("no_archived_chats") || "No archived chats"
- : t("no_chats") || "No chats yet"}
-
- {!showArchived && (
-
- {t("start_new_chat_hint") || "Start a new chat from the chat page"}
-
- )}
-
- )}
-
-