refactor: clean up imports and improve ConversationList structure

This commit is contained in:
mlogclub
2026-05-06 21:08:09 +08:00
parent 3734e8ec03
commit 102e9c8e4f
@@ -1,16 +1,16 @@
"use client"
import { UserIcon } from "lucide-react"
import { UserIcon } from "lucide-react";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
import { ScrollArea } from "@/components/ui/scroll-area"
import { formatDateTime } from "@/lib/utils"
import { useAgentConversationsStore } from "@/lib/stores/agent-conversations"
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { ScrollArea } from "@/components/ui/scroll-area";
import { getEnumLabel } from "@/lib/enums";
import {
IMConversationStatus,
IMConversationStatusLabels,
} from "@/lib/generated/enums"
import { getEnumLabel } from "@/lib/enums"
} from "@/lib/generated/enums";
import { useAgentConversationsStore } from "@/lib/stores/agent-conversations";
import { formatDateTime } from "@/lib/utils";
function getStatusVariant(status: number) {
switch (status) {
@@ -38,8 +38,7 @@ export function ConversationList({ onAfterSelect }: ConversationListProps) {
const selectConversation = useAgentConversationsStore((state) => state.selectConversation)
return (
<ScrollArea className="flex-1 bg-transparent">
<div className="divide-y divide-border">
<ScrollArea className="overflow-auto">
{loading ? (
<div className="p-6 text-center text-sm text-muted-foreground">
...
@@ -50,7 +49,7 @@ export function ConversationList({ onAfterSelect }: ConversationListProps) {
return (
<div
key={conversation.id}
className={`cursor-pointer px-2.5 py-1.5 transition-colors hover:bg-muted/50 ${
className={`cursor-pointer px-2.5 py-1.5 transition-colors hover:bg-muted/50 border-b ${
isSelected ? "bg-muted/80" : ""
}`}
onClick={() => {
@@ -117,7 +116,6 @@ export function ConversationList({ onAfterSelect }: ConversationListProps) {
</div>
)}
</div>
</ScrollArea>
)
}