maplestory/frontend/src/features/FeaturePage.jsx
caadiq 1de5dcb7b9 URL slug 기반 동적 기능 페이지 라우팅 추가
- features/registry.js: import.meta.glob으로 자동 컴포넌트 등록
- /:slug → features/{slug}/{PascalCase}.jsx 매핑
- /admin/:slug → features/{slug}/{PascalCase}Admin.jsx 매핑
- AdminHome 카드 분리 액션 (본체→기능 관리, ⚙→메뉴 정보 편집)
- AdminFeaturePage에 메뉴 정보 편집 단축 링크 추가
- 예시: features/boss-crystal/ stub 컴포넌트

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 15:27:04 +09:00

22 lines
586 B
JavaScript

import { Suspense } from 'react'
import { useParams, Navigate } from 'react-router-dom'
import { getUserComponent } from './registry'
export default function FeaturePage() {
const { slug } = useParams()
const Component = getUserComponent(slug)
if (!Component) {
return <Navigate to="/" replace />
}
return (
<Suspense fallback={
<div className="flex items-center justify-center pt-20">
<div className="w-6 h-6 border-2 border-emerald-500 border-t-transparent rounded-full animate-spin" />
</div>
}>
<Component />
</Suspense>
)
}