@@ -8,11 +8,14 @@ import {
8
8
ChatBubbleMessage ,
9
9
} from "@/components/ui/chat/chat-bubble" ;
10
10
import { Markdown } from "@/components/Markdown" ;
11
- import { Breadcrumb , Breadcrumbs } from "@stacklok/ui-kit" ;
11
+ import { Breadcrumb , Breadcrumbs , Card , CardBody } from "@stacklok/ui-kit" ;
12
12
import { BreadcrumbHome } from "@/components/BreadcrumbHome" ;
13
+ import { useQueryGetWorkspaceAlertTable } from "@/features/alerts/hooks/use-query-get-workspace-alerts-table" ;
14
+ import { AlertDetail } from "@/components/AlertDetail" ;
13
15
14
16
export function RouteChat ( ) {
15
17
const { id } = useParams ( ) ;
18
+ const { data = [ ] } = useQueryGetWorkspaceAlertTable ( ) ;
16
19
const { data : prompts } = useQueryGetWorkspaceMessages ( ) ;
17
20
const chat = prompts ?. find ( ( prompt ) => prompt . chat_id === id ) ;
18
21
@@ -28,6 +31,13 @@ export function RouteChat() {
28
31
chat . conversation_timestamp ,
29
32
) ;
30
33
34
+ // we have an issue on BE, we received duplicated alerts
35
+ const alertDetail = data . filter ( ( alert ) =>
36
+ alert . conversation . question_answers . some (
37
+ ( item ) => item . question . message_id === id ,
38
+ ) ,
39
+ ) [ 0 ] ;
40
+
31
41
return (
32
42
< >
33
43
< Breadcrumbs >
@@ -36,6 +46,14 @@ export function RouteChat() {
36
46
</ Breadcrumbs >
37
47
38
48
< div className = "w-[calc(100vw-18rem)]" >
49
+ { alertDetail && (
50
+ < Card className = "w-full mb-2" >
51
+ < CardBody className = "w-full h-fit overflow-auto max-h-[500px]" >
52
+ < AlertDetail alert = { alertDetail } />
53
+ </ CardBody >
54
+ </ Card >
55
+ ) }
56
+
39
57
< ChatMessageList >
40
58
{ ( chat ?. question_answers ?? [ ] ) . map ( ( { question, answer } , index ) => (
41
59
< div key = { index } className = "flex flex-col size-full gap-6" >
0 commit comments