fix: remove unused site-resolver.ts
This commit is contained in:
1 parent
a7ccc98f84
commit
96c33efced
1 file changed
-34
@@ -1,34 +0,0 @@
|
|||||||
import { headers } from "next/headers";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resolve the current site domain from request headers.
|
|
||||||
* Used by the theme resolver to apply site-scoped themes.
|
|
||||||
*/
|
|
||||||
export async function resolveSiteDomain(): Promise<string | null> {
|
|
||||||
const h = await headers();
|
|
||||||
// Next.js sets host in the Host header
|
|
||||||
const host = h.get("host") ?? h.get("x-forwarded-host");
|
|
||||||
if (!host) return null;
|
|
||||||
// Strip port if present
|
|
||||||
return host.split(":")[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Build the full theme context from the current request.
|
|
||||||
* Combines site domain + route path + module detection.
|
|
||||||
*/
|
|
||||||
export async function buildThemeContext(pathname: string): Promise<{
|
|
||||||
siteDomain: string | null;
|
|
||||||
routePath: string;
|
|
||||||
moduleId: string | null;
|
|
||||||
}> {
|
|
||||||
const siteDomain = await resolveSiteDomain();
|
|
||||||
const { detectModule } = await import("@/lib/theme-modules");
|
|
||||||
const moduleId = detectModule(pathname);
|
|
||||||
|
|
||||||
return {
|
|
||||||
siteDomain,
|
|
||||||
routePath: pathname,
|
|
||||||
moduleId,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user