2026-04-07 18:55:06 +09:00
|
|
|
import { Link } from 'react-router-dom'
|
2026-04-13 15:11:48 +09:00
|
|
|
import { useQuery } from '@tanstack/react-query'
|
2026-04-13 14:20:32 +09:00
|
|
|
import { api } from '../api/client'
|
2026-04-13 16:48:05 +09:00
|
|
|
import NoticeWidget from '../components/NoticeWidget'
|
2026-04-07 18:55:06 +09:00
|
|
|
|
|
|
|
|
export default function Home() {
|
2026-04-13 15:11:48 +09:00
|
|
|
const { data: menus = [], isLoading: loading } = useQuery({
|
|
|
|
|
queryKey: ['menus'],
|
|
|
|
|
queryFn: () => api('/api/menus').catch(() => []),
|
|
|
|
|
})
|
2026-04-13 14:20:32 +09:00
|
|
|
|
2026-04-07 18:55:06 +09:00
|
|
|
return (
|
2026-04-17 21:42:01 +09:00
|
|
|
<div className="space-y-10 max-w-5xl mx-auto pt-6">
|
2026-04-13 16:48:05 +09:00
|
|
|
{/* 구분선 */}
|
|
|
|
|
<div className="flex items-center gap-4">
|
|
|
|
|
<div className="h-px flex-1 bg-gradient-to-r from-transparent via-white/10 to-transparent" />
|
|
|
|
|
<span className="text-xs text-gray-500 uppercase tracking-widest">Utilities</span>
|
|
|
|
|
<div className="h-px flex-1 bg-gradient-to-r from-transparent via-white/10 to-transparent" />
|
|
|
|
|
</div>
|
2026-04-13 14:20:32 +09:00
|
|
|
|
|
|
|
|
{/* 메뉴 그리드 */}
|
|
|
|
|
<section>
|
|
|
|
|
{loading ? (
|
|
|
|
|
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
|
|
|
{Array.from({ length: 3 }).map((_, i) => (
|
|
|
|
|
<div key={i} className="h-32 rounded-2xl bg-white/[0.02] animate-pulse" />
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
) : menus.length === 0 ? (
|
|
|
|
|
<div className="rounded-2xl border border-white/5 bg-gray-900/40 p-16 text-center">
|
|
|
|
|
<div className="text-5xl mb-4 opacity-50">🍁</div>
|
|
|
|
|
<p className="text-gray-400">아직 등록된 기능이 없습니다</p>
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
|
|
|
|
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
|
|
|
{menus.map((menu) => (
|
|
|
|
|
<Link
|
|
|
|
|
key={menu.id}
|
|
|
|
|
to={menu.url}
|
|
|
|
|
className="group relative overflow-hidden rounded-2xl border border-white/5 bg-gradient-to-br from-gray-900/80 to-gray-900/40 p-6 hover:border-emerald-500/30 transition-all duration-300"
|
|
|
|
|
>
|
|
|
|
|
<div className="absolute -top-16 -right-16 w-40 h-40 rounded-full bg-emerald-500/0 group-hover:bg-emerald-500/10 blur-3xl transition-all duration-500" />
|
|
|
|
|
<div className="relative space-y-3">
|
2026-04-13 15:11:48 +09:00
|
|
|
<div className="w-12 h-12 rounded-xl bg-gradient-to-br from-gray-800 to-gray-900 border border-white/5 flex items-center justify-center overflow-hidden group-hover:scale-110 group-hover:border-emerald-500/30 transition-all duration-300">
|
|
|
|
|
<img src={menu.image?.url || '/default.png'} alt={menu.title} className="w-9 h-9 object-contain" />
|
2026-04-13 14:20:32 +09:00
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<h2 className="font-semibold group-hover:text-emerald-300 transition">{menu.title}</h2>
|
|
|
|
|
<p className="text-sm text-gray-400 mt-1 leading-relaxed">{menu.description}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Link>
|
|
|
|
|
))}
|
2026-04-07 18:55:06 +09:00
|
|
|
</div>
|
2026-04-13 14:20:32 +09:00
|
|
|
)}
|
|
|
|
|
</section>
|
2026-04-17 21:42:01 +09:00
|
|
|
|
|
|
|
|
{/* 구분선 */}
|
|
|
|
|
<div className="flex items-center gap-4">
|
|
|
|
|
<div className="h-px flex-1 bg-gradient-to-r from-transparent via-white/10 to-transparent" />
|
|
|
|
|
<span className="text-xs text-gray-500 uppercase tracking-widest">Notices</span>
|
|
|
|
|
<div className="h-px flex-1 bg-gradient-to-r from-transparent via-white/10 to-transparent" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* 메이플 공지 */}
|
|
|
|
|
<NoticeWidget />
|
2026-04-07 18:55:06 +09:00
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|