mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-19 16:03:43 +00:00
- Add delete button on ended sessions (visible on hover) - Darken ended sessions with opacity and "ended" pill badge - Sort ended sessions to bottom of list - Add token usage pill in chat header - Disable input when session ended - Add Official Skills dropdown with SDK and Rivet presets - Format session IDs shorter with full ID on hover - Add arrow icon to "Configure persistence" link - Add agent logo SVGs
19 lines
767 B
TypeScript
19 lines
767 B
TypeScript
import type { TimelineEntry } from "./types";
|
|
import { Settings, AlertTriangle } from "lucide-react";
|
|
import type { ReactNode } from "react";
|
|
|
|
export const getMessageClass = (entry: TimelineEntry) => {
|
|
if (entry.kind === "tool") return "tool";
|
|
if (entry.kind === "meta") return entry.meta?.severity === "error" ? "error" : "system";
|
|
if (entry.kind === "reasoning") return "assistant";
|
|
if (entry.role === "user") return "user";
|
|
return "assistant";
|
|
};
|
|
|
|
export const getAvatarLabel = (messageClass: string): ReactNode => {
|
|
if (messageClass === "user") return null;
|
|
if (messageClass === "tool") return "T";
|
|
if (messageClass === "system") return <Settings size={14} />;
|
|
if (messageClass === "error") return <AlertTriangle size={14} />;
|
|
return "AI";
|
|
};
|