cấu hình chạy lần đầu - chưa thực hiện test

This commit is contained in:
Victor Phan
2026-01-08 12:00:20 +07:00
parent 2f694b5c1c
commit 0bdd0ad2e7
3683 changed files with 285051 additions and 292350 deletions

View File

@@ -0,0 +1 @@
export declare function resolvePageComponent<T>(path: string, pages: Record<string, Promise<T> | (() => Promise<T>)>): Promise<T>;

View File

@@ -0,0 +1,7 @@
export async function resolvePageComponent(path, pages) {
const page = pages[path];
if (typeof page === 'undefined') {
throw new Error(`Page not found: ${path}`);
}
return typeof page === 'function' ? page() : page;
}