Skip to content

Commit

Permalink
Merge branch 'main' into alerts-table-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
kantord committed Jan 24, 2025
2 parents 3a778b2 + 646ed5a commit 2a742d8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/AlertsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { sanitizeQuestionPrompt, parsingPromptText } from "@/lib/utils";
import { Search } from "lucide-react";
import { useAlertSearch } from "@/hooks/useAlertSearch";
import { useCallback } from "react";
import { useSearchParams } from "react-router-dom";
import { useNavigate, useSearchParams } from "react-router-dom";
import { useFilteredAlerts } from "@/hooks/useAlertsData";
import { useClientSidePagination } from "@/hooks/useClientSidePagination";

Expand Down Expand Up @@ -60,6 +60,7 @@ export function AlertsTable() {
nextPage,
prevPage,
} = useAlertSearch();
const navigate = useNavigate();
const [searchParams, setSearchParams] = useSearchParams();
const { data: filteredAlerts = [] } = useFilteredAlerts();

Expand Down Expand Up @@ -157,7 +158,13 @@ export function AlertsTable() {
</TableHeader>
<TableBody>
{dataView.map((alert) => (
<Row key={alert.alert_id} className="h-20">
<Row
key={alert.alert_id}
className="h-20"
onAction={() =>
navigate(`/prompt/${alert.conversation.chat_id}`)
}
>
<Cell className="truncate">
{formatDistanceToNow(new Date(alert.timestamp), {
addSuffix: true,
Expand Down

0 comments on commit 2a742d8

Please sign in to comment.