mirror of
https://github.com/hanzoai/dataroom.git
synced 2026-10-30 18:41:07 +00:00
hanzo-build-linux-amd64 is the only ARC runner pool installed on hanzo-k8s today (arm64 pool is paused until DigitalOcean ships arm64 droplets, per ~/work/hanzo/.github/RUNNERS.md). The arm64 job was waiting on spark-hanzoai-arm64 — not provisioned in this cluster — so every build sat in queue forever and the amd64 leg got cancelled. Set platforms: linux/amd64 on the reusable build call to skip arm64 entirely. Re-add arm64 if/when DO ships arm64 droplets and the spark runner pool comes back online.
81 lines
2.4 KiB
TypeScript
81 lines
2.4 KiB
TypeScript
import { formatDistanceToNow } from "date-fns";
|
|
|
|
import { cn } from "@/lib/utils";
|
|
|
|
import { Badge } from "@/components/ui/badge";
|
|
|
|
export function ConversationListItem({
|
|
navigateToConversation,
|
|
conversation,
|
|
isActive,
|
|
showVersionNumber = false,
|
|
}: {
|
|
navigateToConversation: (id: string) => void;
|
|
conversation: any;
|
|
isActive: boolean;
|
|
showVersionNumber?: boolean;
|
|
}) {
|
|
// Helper function to format document reference
|
|
const formatDocumentReference = () => {
|
|
if (!conversation.dataroomDocumentName) return "Untitled conversation";
|
|
|
|
const documentName = conversation.dataroomDocumentName;
|
|
const parts = [];
|
|
|
|
if (conversation.documentPageNumber) {
|
|
parts.push(`Page ${conversation.documentPageNumber}`);
|
|
}
|
|
|
|
// Only show version number if showVersionNumber is true (admin/team member view)
|
|
if (showVersionNumber && conversation.documentVersionNumber) {
|
|
parts.push(`v${conversation.documentVersionNumber}`);
|
|
}
|
|
|
|
const reference = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
return `${documentName}${reference}`;
|
|
};
|
|
|
|
return (
|
|
<button
|
|
className={cn(
|
|
"relative flex flex-col items-start gap-2 rounded-lg border p-3 text-left text-sm transition-all hover:bg-accent",
|
|
isActive && "bg-muted",
|
|
)}
|
|
onClick={() => navigateToConversation(conversation.id)}
|
|
>
|
|
<div className="flex w-full flex-col gap-1">
|
|
<div className="flex items-center">
|
|
<div className="flex items-center gap-2">
|
|
<div className="font-semibold">
|
|
{conversation.viewerEmail || "Anonymous Viewer"}
|
|
</div>
|
|
</div>
|
|
<div
|
|
className={cn(
|
|
"ml-auto text-xs text-muted-foreground",
|
|
isActive && "text-foreground",
|
|
)}
|
|
>
|
|
{formatDistanceToNow(new Date(conversation.updatedAt), {
|
|
addSuffix: true,
|
|
})}
|
|
</div>
|
|
</div>
|
|
<div className="text-xs font-medium">
|
|
{formatDocumentReference() || conversation.title}
|
|
</div>
|
|
</div>
|
|
|
|
<div className="line-clamp-2 text-xs text-muted-foreground">
|
|
{conversation.lastMessage.content}
|
|
</div>
|
|
|
|
{conversation.unreadCount > 0 && (
|
|
<Badge className="absolute right-3 top-3" variant="default">
|
|
{conversation.unreadCount}
|
|
</Badge>
|
|
)}
|
|
</button>
|
|
);
|
|
}
|