@@ -8,11 +8,14 @@ import {
88 ChatBubbleMessage ,
99} from "@/components/ui/chat/chat-bubble" ;
1010import { Markdown } from "@/components/Markdown" ;
11- import { Breadcrumb , Breadcrumbs } from "@stacklok/ui-kit" ;
11+ import { Breadcrumb , Breadcrumbs , Card , CardBody } from "@stacklok/ui-kit" ;
1212import { BreadcrumbHome } from "@/components/BreadcrumbHome" ;
13+ import { useQueryGetWorkspaceAlertTable } from "@/features/alerts/hooks/use-query-get-workspace-alerts-table" ;
14+ import { AlertDetail } from "@/components/AlertDetail" ;
1315
1416export function RouteChat ( ) {
1517 const { id } = useParams ( ) ;
18+ const { data = [ ] } = useQueryGetWorkspaceAlertTable ( ) ;
1619 const { data : prompts } = useQueryGetWorkspaceMessages ( ) ;
1720 const chat = prompts ?. find ( ( prompt ) => prompt . chat_id === id ) ;
1821
@@ -28,6 +31,13 @@ export function RouteChat() {
2831 chat . conversation_timestamp ,
2932 ) ;
3033
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+
3141 return (
3242 < >
3343 < Breadcrumbs >
@@ -36,6 +46,14 @@ export function RouteChat() {
3646 </ Breadcrumbs >
3747
3848 < 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+
3957 < ChatMessageList >
4058 { ( chat ?. question_answers ?? [ ] ) . map ( ( { question, answer } , index ) => (
4159 < div key = { index } className = "flex flex-col size-full gap-6" >
0 commit comments