feat: add STATIC_WEBSITE_ONLY mode

This commit is contained in:
Li Xin
2025-05-02 21:09:31 +08:00
parent f89e07ac95
commit e46b243edd
3 changed files with 37 additions and 9 deletions

View File

@@ -4,6 +4,8 @@
import { useSearchParams } from "next/navigation";
import { useMemo } from "react";
import { env } from "~/env";
import { extractReplayIdFromSearchParams } from "./get-replay-id";
export function useReplay() {
@@ -12,5 +14,8 @@ export function useReplay() {
() => extractReplayIdFromSearchParams(searchParams.toString()),
[searchParams],
);
return { isReplay: replayId != null, replayId };
return {
isReplay: replayId != null || env.NEXT_PUBLIC_STATIC_WEBSITE_ONLY,
replayId,
};
}