mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-30 09:40:50 +02:00
Cleaner Layout (#1857)
This commit is contained in:
@ -54,11 +54,13 @@ export function PagesTab({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isHistoryEmpty = !existingChats || existingChats.length === 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mb-1 ml-3 relative miniscroll overflow-y-auto h-full">
|
<div className="mb-1 ml-3 relative miniscroll overflow-y-auto h-full">
|
||||||
{folders && folders.length > 0 && (
|
{folders && folders.length > 0 && (
|
||||||
<div className="py-2 border-b border-border">
|
<div className="py-2 border-b border-border">
|
||||||
<div className="text-xs text-subtle flex pb-0.5 mb-1.5 mt-2 font-medium">
|
<div className="text-xs text-subtle flex pb-0.5 mb-1.5 mt-2 font-bold">
|
||||||
Folders
|
Folders
|
||||||
</div>
|
</div>
|
||||||
<FolderList
|
<FolderList
|
||||||
@ -80,43 +82,51 @@ export function PagesTab({
|
|||||||
} rounded-md`}
|
} rounded-md`}
|
||||||
>
|
>
|
||||||
{(page == "chat" || page == "search") && (
|
{(page == "chat" || page == "search") && (
|
||||||
<p className="my-2 text-xs text-subtle flex font-semibold">
|
<p className="my-2 text-xs text-subtle flex font-bold">
|
||||||
{page == "chat" && "Chat "}
|
{page == "chat" && "Chat "}
|
||||||
{page == "search" && "Search "}
|
{page == "search" && "Search "}
|
||||||
History
|
History
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{Object.entries(groupedChatSessions).map(
|
{isHistoryEmpty ? (
|
||||||
([dateRange, chatSessions], ind) => {
|
<p className="text-sm text-subtle mt-2 w-[250px]">
|
||||||
if (chatSessions.length > 0) {
|
{page === "search"
|
||||||
return (
|
? "Try running a search! Your search history will appear here."
|
||||||
<div key={dateRange}>
|
: "Try sending a message! Your chat history will appear here."}
|
||||||
<div
|
</p>
|
||||||
className={`text-xs text-subtle ${
|
) : (
|
||||||
ind != 0 && "mt-5"
|
Object.entries(groupedChatSessions).map(
|
||||||
} flex pb-0.5 mb-1.5 font-medium`}
|
([dateRange, chatSessions], ind) => {
|
||||||
>
|
if (chatSessions.length > 0) {
|
||||||
{dateRange}
|
return (
|
||||||
|
<div key={dateRange}>
|
||||||
|
<div
|
||||||
|
className={`text-xs text-subtle ${
|
||||||
|
ind != 0 && "mt-5"
|
||||||
|
} flex pb-0.5 mb-1.5 font-medium`}
|
||||||
|
>
|
||||||
|
{dateRange}
|
||||||
|
</div>
|
||||||
|
{chatSessions
|
||||||
|
.filter((chat) => chat.folder_id === null)
|
||||||
|
.map((chat) => {
|
||||||
|
const isSelected = currentChatId === chat.id;
|
||||||
|
return (
|
||||||
|
<div key={`${chat.id}-${chat.name}`}>
|
||||||
|
<ChatSessionDisplay
|
||||||
|
search={page == "search"}
|
||||||
|
chatSession={chat}
|
||||||
|
isSelected={isSelected}
|
||||||
|
skipGradient={isDragOver}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
{chatSessions
|
);
|
||||||
.filter((chat) => chat.folder_id === null)
|
}
|
||||||
.map((chat) => {
|
|
||||||
const isSelected = currentChatId === chat.id;
|
|
||||||
return (
|
|
||||||
<div key={`${chat.id}-${chat.name}`}>
|
|
||||||
<ChatSessionDisplay
|
|
||||||
search={page == "search"}
|
|
||||||
chatSession={chat}
|
|
||||||
isSelected={isSelected}
|
|
||||||
skipGradient={isDragOver}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
)
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user