"use client";
import { Suspense, lazy, type ComponentType, type ReactNode } from "react";
interface PageLoaderProps {
fallback?: ReactNode;
children: ReactNode;
}
const DefaultLoadingFallback = () => (
);
const PageContentLoader = () => (
);
export const PageLoader: React.FC = ({
fallback = ,
children
}) => (
{children}
);
export const ContentLoader: React.FC = ({
fallback = ,
children
}) => (
{children}
);
export function createLazyPage(
importFn: () => Promise<{ default: ComponentType }>,
fallback?: ReactNode
) {
const LazyComponent = lazy(importFn);
return function LazyPageWrapper(props: Record) {
return (
);
};
}
export function createLazyComponent(
importFn: () => Promise<{ default: ComponentType }>,
fallback?: ReactNode
) {
const LazyComponent = lazy(importFn);
return function LazyComponentWrapper(props: Record) {
return (
);
};
}