Initial commit: deerflow-server (frontend-web + offline-backend-20260512)

This commit is contained in:
吉鑫升 committed 2026-05-13 09:36:15 +08:00
commit e7a455f22e
560 files changed
+101331

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
import { useMemo } from "react";
import {
useLocation,
useNavigate,
useParams as useRouterParams,
useSearchParams as useRouterSearchParams,
} from "react-router-dom";
export function useRouter() {
const navigate = useNavigate();
return useMemo(
() => ({
push: (href: string) => navigate(href),
replace: (href: string) => navigate(href, { replace: true }),
back: () => navigate(-1),
forward: () => navigate(1),
refresh: () => window.location.reload(),
prefetch: async () => {},
}),
[navigate],
);
}
export function usePathname() {
return useLocation().pathname;
}
export function useParams<T extends Record<string, string | undefined>>() {
return useRouterParams() as T;
}
export function useSearchParams() {
const [searchParams] = useRouterSearchParams();
return searchParams;
}