refactor: 统一功能组件结构,简化特性配置

This commit is contained in:
2026-06-30 21:18:28 +08:00
parent ece5c6135e
commit 47e08f80b3
5 changed files with 24 additions and 72 deletions
+3 -5
View File
@@ -1,4 +1,4 @@
import { FEATURES, getEntryPointType } from '@/config/features';
import { FEATURES } from '@/config/features';
import { useRouter } from '@/providers/RouterProvider';
import { Suspense } from 'react';
import PageErrorBoundary from '@/components/PageErrorBoundary';
@@ -6,8 +6,6 @@ import PageSkeleton from '@/components/PageSkeleton';
import { cn } from '@/lib/utils';
import { AlertTriangle } from 'lucide-react';
const entryPointType = getEntryPointType();
export default function RouterContainer() {
const { currentPage, isLoaded } = useRouter();
@@ -19,7 +17,7 @@ export default function RouterContainer() {
}
const currentFeature = FEATURES.find((f) => f.key === currentPage);
const MatchedComponent = currentFeature?.components?.[entryPointType];
const MatchedComponent = currentFeature?.component;
return (
<div
@@ -43,7 +41,7 @@ export default function RouterContainer() {
</div>
<h3 className="text-sm font-semibold text-foreground"></h3>
<p className="text-xs text-muted-foreground mt-1 max-w-[240px]">
{entryPointType.toUpperCase()}
</p>
</div>
)}