2026-04-13 15:27:04 +09:00
|
|
|
|
import { Suspense } from 'react'
|
2026-04-13 20:42:28 +09:00
|
|
|
|
import { useParams, Link } from 'react-router-dom'
|
2026-04-13 15:27:04 +09:00
|
|
|
|
import { useQuery } from '@tanstack/react-query'
|
2026-04-19 11:26:52 +09:00
|
|
|
|
import { getAdminComponent } from '../../registry'
|
|
|
|
|
|
import { api } from '../../../api/client'
|
2026-04-13 15:27:04 +09:00
|
|
|
|
|
|
|
|
|
|
export default function AdminFeaturePage() {
|
|
|
|
|
|
const { slug } = useParams()
|
|
|
|
|
|
const Component = getAdminComponent(slug)
|
|
|
|
|
|
|
2026-04-13 20:42:28 +09:00
|
|
|
|
// 메뉴 정보 조회 (없는 기능 안내용)
|
2026-04-13 15:27:04 +09:00
|
|
|
|
const { data: menus = [] } = useQuery({
|
|
|
|
|
|
queryKey: ['admin', 'menus'],
|
|
|
|
|
|
queryFn: () => api('/api/admin/menus').catch(() => []),
|
|
|
|
|
|
})
|
|
|
|
|
|
const menu = menus.find((m) => (m.url || '').replace(/^\/+/, '').split('/')[0] === slug)
|
|
|
|
|
|
|
|
|
|
|
|
if (!Component) {
|
|
|
|
|
|
return (
|
2026-04-19 11:05:25 +09:00
|
|
|
|
<div className="space-y-4 max-w-5xl mx-auto pt-6">
|
2026-04-13 15:27:04 +09:00
|
|
|
|
{menu && (
|
2026-04-13 20:42:28 +09:00
|
|
|
|
<div>
|
2026-04-19 11:05:25 +09:00
|
|
|
|
<h2 className="text-lg font-medium">{menu.title}</h2>
|
|
|
|
|
|
<p className="text-sm mt-0.5" style={{ color: 'var(--text-dim)' }}>{menu.description}</p>
|
2026-04-13 15:27:04 +09:00
|
|
|
|
</div>
|
|
|
|
|
|
)}
|
2026-04-19 11:05:25 +09:00
|
|
|
|
<div
|
|
|
|
|
|
className="rounded-2xl border border-dashed p-12 text-center"
|
|
|
|
|
|
style={{
|
|
|
|
|
|
borderColor: 'var(--dashed-border)',
|
|
|
|
|
|
background: 'var(--skeleton-bg)',
|
|
|
|
|
|
}}
|
|
|
|
|
|
>
|
2026-04-13 15:27:04 +09:00
|
|
|
|
<div className="text-4xl mb-3 opacity-30">🛠️</div>
|
2026-04-19 11:05:25 +09:00
|
|
|
|
<p style={{ color: 'var(--text-muted)' }}>이 기능에는 관리 페이지가 없습니다</p>
|
|
|
|
|
|
<p className="text-xs mt-2 font-mono" style={{ color: 'var(--text-dim)' }}>
|
2026-04-13 15:27:04 +09:00
|
|
|
|
features/{slug}/{slug.split('-').map((s) => s[0].toUpperCase() + s.slice(1)).join('')}Admin.jsx
|
|
|
|
|
|
</p>
|
2026-04-13 20:42:28 +09:00
|
|
|
|
<Link
|
|
|
|
|
|
to={`/admin/menus/${menu?.id || ''}`}
|
2026-04-19 11:05:25 +09:00
|
|
|
|
className="inline-block mt-4 text-xs hover:text-[var(--accent-hover-text)]"
|
|
|
|
|
|
style={{ color: 'var(--accent)' }}
|
2026-04-13 20:42:28 +09:00
|
|
|
|
>
|
|
|
|
|
|
메뉴 정보 편집 →
|
|
|
|
|
|
</Link>
|
2026-04-13 15:27:04 +09:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
2026-04-13 20:42:28 +09:00
|
|
|
|
<Suspense fallback={
|
|
|
|
|
|
<div className="flex items-center justify-center pt-20">
|
2026-04-19 11:05:25 +09:00
|
|
|
|
<div
|
|
|
|
|
|
className="w-6 h-6 border-2 border-t-transparent rounded-full animate-spin"
|
|
|
|
|
|
style={{ borderColor: 'var(--accent)', borderTopColor: 'transparent' }}
|
|
|
|
|
|
/>
|
2026-04-13 20:42:28 +09:00
|
|
|
|
</div>
|
|
|
|
|
|
}>
|
|
|
|
|
|
<Component />
|
|
|
|
|
|
</Suspense>
|
2026-04-13 15:27:04 +09:00
|
|
|
|
)
|
|
|
|
|
|
}
|