fix params

This commit is contained in:
Francesco Sansalvadore committed 2026-03-25 22:08:11 +01:00
1 parent 6907229512
commit 38b18fb79e
1 file changed
+4 -1
@@ -12,8 +12,11 @@ interface ReportHeaderProps {
}
/** App Router: reconstruct a single-value query map from the current URL (no duplicate keys). */
function queryFromSearchParams(searchParams: ReturnType<typeof useSearchParams>) {
function queryFromSearchParams(
searchParams: ReturnType<typeof useSearchParams> | null
) {
const q: Record<string, string | string[] | undefined> = {}
if (!searchParams) return q
searchParams.forEach((value, key) => {
q[key] = value
})