import { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; import api from '../../api/client'; export default function AdminIndex() { const [stats, setStats] = useState(null); useEffect(() => { api.get('/admin/stats').then(r => setStats(r.data)).catch(() => {}); }, []); const cards = stats ? [ { label: '์ด ์ฌ์ฉ์', value: stats.users.toLocaleString(), icon: '๐ค' }, { label: '์ ์ฒด ํ๋ก์ ํธ', value: stats.projects.total.toLocaleString(), icon: '๐' }, { label: '์น์ธ ๋๊ธฐ', value: stats.projects.pending.toLocaleString(), icon: 'โณ', warn: stats.projects.pending > 0 }, { label: '์ด ๋งค์ถ', value: `โฉ${(stats.revenue.total || 0).toLocaleString()}`, icon: '๐ฐ' }, { label: '์ด ์ฃผ๋ฌธ', value: stats.revenue.orders.toLocaleString(), icon: '๐' }, ] : []; return (