mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 13:47:15 +01:00
Get localized error messages.
This commit is contained in:
parent
baba06c692
commit
fc01ee9f56
32 changed files with 90 additions and 85 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { useState, useEffect } from 'react';
|
||||
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
||||
import { buildUrl } from '@/lib/url';
|
||||
import { buildPath } from '@/lib/url';
|
||||
|
||||
export function useNavigation() {
|
||||
const router = useRouter();
|
||||
|
|
@ -11,15 +11,15 @@ export function useNavigation() {
|
|||
const [queryParams, setQueryParams] = useState(Object.fromEntries(searchParams));
|
||||
|
||||
const updateParams = (params?: Record<string, string | number>) => {
|
||||
return buildUrl(pathname, { ...queryParams, ...params });
|
||||
return buildPath(pathname, { ...queryParams, ...params });
|
||||
};
|
||||
|
||||
const replaceParams = (params?: Record<string, string | number>) => {
|
||||
return buildUrl(pathname, params);
|
||||
return buildPath(pathname, params);
|
||||
};
|
||||
|
||||
const renderUrl = (path: string, params?: Record<string, string | number> | false) => {
|
||||
return buildUrl(
|
||||
return buildPath(
|
||||
teamId ? `/teams/${teamId}${path}` : path,
|
||||
params === false ? {} : { ...queryParams, ...params },
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue