22 lines
692 B
TypeScript
22 lines
692 B
TypeScript
/** @jsxImportSource react */
|
|
import { Suspense } from 'react';
|
|
import type { ReactElement } from 'react';
|
|
import { useTheme } from '@lilith/ui-theme';
|
|
import { useProjectContext } from './useProjectContext';
|
|
import { PROJECT_TYPE_REGISTRY } from './type-registry';
|
|
|
|
export default function ProjectDashboardResolver(): ReactElement | null {
|
|
const { project } = useProjectContext();
|
|
const { theme } = useTheme();
|
|
const config = PROJECT_TYPE_REGISTRY[project.type];
|
|
|
|
if (!config) return null;
|
|
|
|
const { Dashboard } = config;
|
|
|
|
return (
|
|
<Suspense fallback={<p style={{ color: theme.colors.text.muted, fontSize: '13px' }}>Loading...</p>}>
|
|
<Dashboard />
|
|
</Suspense>
|
|
);
|
|
}
|