diff --git a/src/components/AlertDetail.tsx b/src/components/AlertDetail.tsx
new file mode 100644
index 00000000..10de3054
--- /dev/null
+++ b/src/components/AlertDetail.tsx
@@ -0,0 +1,55 @@
+import { AlertConversation } from "@/api/generated";
+import { isAlertMalicious } from "@/features/alerts/lib/is-alert-malicious";
+import { isAlertSecret } from "@/features/alerts/lib/is-alert-secret";
+import { Markdown } from "./Markdown";
+
+type MaliciousPkgType = {
+ name: string;
+ type: string;
+ status: string;
+ description: string;
+};
+
+export function AlertDetail({ alert }: { alert: AlertConversation }) {
+ if (alert.trigger_string === null) return "N/A";
+ if (isAlertSecret(alert) && typeof alert.trigger_string === "string") {
+ return (
+
+ {alert.trigger_string}
+
+ );
+ }
+
+ if (isAlertMalicious(alert) && typeof alert.trigger_string === "object") {
+ const maliciousPkg = alert.trigger_string as MaliciousPkgType;
+
+ return (
+
+
+
+
+ {maliciousPkg.type}/{maliciousPkg.name}
+
+ {maliciousPkg.status && (
+ <>
+
+
{maliciousPkg.status}
+ >
+ )}
+ {maliciousPkg.description && (
+ <>
+
+
{" "}
+ {maliciousPkg.description}
+ >
+ )}
+
+ );
+ }
+ return null;
+}
diff --git a/src/routes/route-chat.tsx b/src/routes/route-chat.tsx
index 30f1b5f3..6cda4069 100644
--- a/src/routes/route-chat.tsx
+++ b/src/routes/route-chat.tsx
@@ -8,11 +8,14 @@ import {
ChatBubbleMessage,
} from "@/components/ui/chat/chat-bubble";
import { Markdown } from "@/components/Markdown";
-import { Breadcrumb, Breadcrumbs } from "@stacklok/ui-kit";
+import { Breadcrumb, Breadcrumbs, Card, CardBody } from "@stacklok/ui-kit";
import { BreadcrumbHome } from "@/components/BreadcrumbHome";
+import { useQueryGetWorkspaceAlertTable } from "@/features/alerts/hooks/use-query-get-workspace-alerts-table";
+import { AlertDetail } from "@/components/AlertDetail";
export function RouteChat() {
const { id } = useParams();
+ const { data = [] } = useQueryGetWorkspaceAlertTable();
const { data: prompts } = useQueryGetWorkspaceMessages();
const chat = prompts?.find((prompt) => prompt.chat_id === id);
@@ -28,6 +31,13 @@ export function RouteChat() {
chat.conversation_timestamp,
);
+ // we have an issue on BE, we received duplicated alerts
+ const alertDetail = data.filter((alert) =>
+ alert.conversation.question_answers.some(
+ (item) => item.question.message_id === id,
+ ),
+ )[0];
+
return (
<>
@@ -36,6 +46,14 @@ export function RouteChat() {
+ {alertDetail && (
+
+
+
+
+
+ )}
+
{(chat?.question_answers ?? []).map(({ question, answer }, index) => (