diff --git a/ui/app/[locale]/kafka/[kafkaId]/topics/[topicId]/messages/ConnectedMessagesTable.tsx b/ui/app/[locale]/kafka/[kafkaId]/topics/[topicId]/messages/ConnectedMessagesTable.tsx index 1f03be16a..be580dc56 100644 --- a/ui/app/[locale]/kafka/[kafkaId]/topics/[topicId]/messages/ConnectedMessagesTable.tsx +++ b/ui/app/[locale]/kafka/[kafkaId]/topics/[topicId]/messages/ConnectedMessagesTable.tsx @@ -5,6 +5,7 @@ import { GetTopicMessagesReturn, } from "@/api/messages/actions"; import { Message } from "@/api/messages/schema"; +import { useParseSearchParams } from "@/app/[locale]/kafka/[kafkaId]/topics/[topicId]/messages/useParseSearchParams"; import { AlertContinuousMode } from "@/components/MessagesTable/AlertContinuousMode"; import { AlertTopicGone } from "@/components/MessagesTable/AlertTopicGone"; import { MessagesTable } from "@/components/MessagesTable/MessagesTable"; @@ -22,7 +23,6 @@ import { useRef, useState, } from "react"; -import { useParseSearchParams } from "./parseSearchParams"; export function ConnectedMessagesTable({ kafkaId, diff --git a/ui/app/[locale]/kafka/[kafkaId]/topics/[topicId]/messages/parseSearchParams.ts b/ui/app/[locale]/kafka/[kafkaId]/topics/[topicId]/messages/parseSearchParams.ts index 9eedd2b66..12c5d917e 100644 --- a/ui/app/[locale]/kafka/[kafkaId]/topics/[topicId]/messages/parseSearchParams.ts +++ b/ui/app/[locale]/kafka/[kafkaId]/topics/[topicId]/messages/parseSearchParams.ts @@ -1,6 +1,4 @@ import { stringToInt } from "@/utils/stringToInt"; -import { useSearchParams } from "next/navigation"; -import { useMemo } from "react"; export type MessagesSearchParams = { retrieve?: string; @@ -56,14 +54,3 @@ export function parseSearchParams(searchParams: MessagesSearchParams) { _, }; } - -export function useParseSearchParams(): [ - ReturnType, - Record, -] { - const searchParamsEntities = useSearchParams(); - return useMemo(() => { - const searchParams = Object.fromEntries(searchParamsEntities); - return [parseSearchParams(searchParams), searchParams]; - }, [searchParamsEntities]); -} diff --git a/ui/app/[locale]/kafka/[kafkaId]/topics/[topicId]/messages/useParseSearchParams.ts b/ui/app/[locale]/kafka/[kafkaId]/topics/[topicId]/messages/useParseSearchParams.ts new file mode 100644 index 000000000..aee8690a0 --- /dev/null +++ b/ui/app/[locale]/kafka/[kafkaId]/topics/[topicId]/messages/useParseSearchParams.ts @@ -0,0 +1,14 @@ +import { parseSearchParams } from "@/app/[locale]/kafka/[kafkaId]/topics/[topicId]/messages/parseSearchParams"; +import { useSearchParams } from "next/navigation"; +import { useMemo } from "react"; + +export function useParseSearchParams(): [ + ReturnType, + Record, +] { + const searchParamsEntities = useSearchParams(); + return useMemo(() => { + const searchParams = Object.fromEntries(searchParamsEntities); + return [parseSearchParams(searchParams), searchParams]; + }, [searchParamsEntities]); +}