From 030cac63ae3d9c4b32eac8c24dcbb31d96c7eb66 Mon Sep 17 00:00:00 2001 From: shahargl Date: Sun, 29 Sep 2024 11:59:46 +0300 Subject: [PATCH] feat: small improvements --- .../alerts/alert-associate-incident-modal.tsx | 49 +++++--- .../incidents/create-or-update-incident.tsx | 36 ++++-- keep-ui/app/incidents/incidents-table.tsx | 115 +++++++++++------- 3 files changed, 130 insertions(+), 70 deletions(-) diff --git a/keep-ui/app/alerts/alert-associate-incident-modal.tsx b/keep-ui/app/alerts/alert-associate-incident-modal.tsx index de6b6efede..d0124e824b 100644 --- a/keep-ui/app/alerts/alert-associate-incident-modal.tsx +++ b/keep-ui/app/alerts/alert-associate-incident-modal.tsx @@ -1,5 +1,6 @@ import Modal from "@/components/ui/Modal"; -import { Button, Divider, Select, SelectItem, Title } from "@tremor/react"; +import { Button, Divider, SelectItem, Title } from "@tremor/react"; +import Select from "@/components/ui/Select"; import CreateOrUpdateIncident from "app/incidents/create-or-update-incident"; import { useSession } from "next-auth/react"; import { useRouter } from "next/navigation"; @@ -28,7 +29,9 @@ const AlertAssociateIncidentModal = ({ const { data: incidents, isLoading, mutate } = useIncidents(true, 100); usePollIncidents(mutate); - const [selectedIncident, setSelectedIncident] = useState(); + const [selectedIncident, setSelectedIncident] = useState< + string | undefined + >(); // get the token const { data: session } = useSession(); const router = useRouter(); @@ -106,20 +109,33 @@ const AlertAssociateIncidentModal = ({
+ onChange={(selectedOption) => + setSelectedIncident(selectedOption?.value) + } + options={incidents.items?.map((incident) => ({ + value: incident.id, + label: + incident.user_generated_name || + incident.ai_generated_name || + "", + }))} + />