Skip to content

Commit 646ed5a

Browse files
authored
feat: redirect to conversation from alerts table (#191)
1 parent d844610 commit 646ed5a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/components/AlertsTable.tsx

+9-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { Search } from "lucide-react";
2121
import { Markdown } from "./Markdown";
2222
import { useAlertSearch } from "@/hooks/useAlertSearch";
2323
import { useCallback } from "react";
24-
import { useSearchParams } from "react-router-dom";
24+
import { useNavigate, useSearchParams } from "react-router-dom";
2525
import { useFilteredAlerts } from "@/hooks/useAlertsData";
2626
import { useClientSidePagination } from "@/hooks/useClientSidePagination";
2727

@@ -75,6 +75,7 @@ export function AlertsTable() {
7575
nextPage,
7676
prevPage,
7777
} = useAlertSearch();
78+
const navigate = useNavigate();
7879
const [searchParams, setSearchParams] = useSearchParams();
7980
const { data: filteredAlerts = [] } = useFilteredAlerts();
8081

@@ -174,7 +175,13 @@ export function AlertsTable() {
174175
</TableHeader>
175176
<TableBody>
176177
{dataView.map((alert) => (
177-
<Row key={alert.alert_id} className="h-20">
178+
<Row
179+
key={alert.alert_id}
180+
className="h-20"
181+
onAction={() =>
182+
navigate(`/prompt/${alert.conversation.chat_id}`)
183+
}
184+
>
178185
<Cell className="truncate">{alert.trigger_type}</Cell>
179186
<Cell className="overflow-auto whitespace-nowrap max-w-80">
180187
{wrapObjectOutput(alert.trigger_string)}

0 commit comments

Comments
 (0)