Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardo-forina committed Apr 16, 2024
1 parent b3dbdaf commit 51db622
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -22,7 +23,6 @@ import {
useRef,
useState,
} from "react";
import { useParseSearchParams } from "./parseSearchParams";

export function ConnectedMessagesTable({
kafkaId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { stringToInt } from "@/utils/stringToInt";
import { useSearchParams } from "next/navigation";
import { useMemo } from "react";

export type MessagesSearchParams = {
retrieve?: string;
Expand Down Expand Up @@ -56,14 +54,3 @@ export function parseSearchParams(searchParams: MessagesSearchParams) {
_,
};
}

export function useParseSearchParams(): [
ReturnType<typeof parseSearchParams>,
Record<string, string>,
] {
const searchParamsEntities = useSearchParams();
return useMemo(() => {
const searchParams = Object.fromEntries(searchParamsEntities);
return [parseSearchParams(searchParams), searchParams];
}, [searchParamsEntities]);
}
Original file line number Diff line number Diff line change
@@ -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<typeof parseSearchParams>,
Record<string, string>,
] {
const searchParamsEntities = useSearchParams();
return useMemo(() => {
const searchParams = Object.fromEntries(searchParamsEntities);
return [parseSearchParams(searchParams), searchParams];
}, [searchParamsEntities]);
}

0 comments on commit 51db622

Please sign in to comment.