'use client';
import Link from 'next/link';
import { useState } from 'react';
export default function DashboardSample() {
const [activeMenu, setActiveMenu] = useState('overview');
const kpis = [
{ label: '월 활성 사용자', value: '124,832', change: '+12.4%', up: true, icon: '👤', color: '#3b82f6' },
{ label: '월 매출', value: '₩284M', change: '+8.7%', up: true, icon: '💰', color: '#10b981' },
{ label: '전환율', value: '3.62%', change: '-0.3%', up: false, icon: '📈', color: '#f59e0b' },
{ label: '고객 만족도', value: '4.8 / 5', change: '+0.2', up: true, icon: '⭐', color: '#8b5cf6' },
];
const chartData = [
{ month: 'Jan', value: 65 },
{ month: 'Feb', value: 78 },
{ month: 'Mar', value: 72 },
{ month: 'Apr', value: 89 },
{ month: 'May', value: 95 },
{ month: 'Jun', value: 82 },
{ month: 'Jul', value: 110 },
{ month: 'Aug', value: 128 },
];
const maxVal = Math.max(...chartData.map((d) => d.value));
const activities = [
{ user: 'lee@company.com', action: '프리미엄 플랜 구독', time: '2분 전', status: 'success' },
{ user: 'park@startup.io', action: 'API 한도 초과 경고', time: '14분 전', status: 'warning' },
{ user: 'kim@corp.kr', action: '팀 멤버 5명 초대', time: '31분 전', status: 'info' },
{ user: 'choi@brand.com', action: '결제 실패 (카드 만료)', time: '1시간 전', status: 'error' },
{ user: 'jung@agency.co', action: '새 워크스페이스 생성', time: '2시간 전', status: 'success' },
];
const menus = [
{ id: 'overview', icon: '⊞', label: 'Overview' },
{ id: 'analytics', icon: '◈', label: 'Analytics' },
{ id: 'users', icon: '◉', label: 'Users' },
{ id: 'revenue', icon: '◆', label: 'Revenue' },
{ id: 'reports', icon: '▣', label: 'Reports' },
{ id: 'settings', icon: '◎', label: 'Settings' },
];
const statusColor = { success: '#10b981', warning: '#f59e0b', error: '#ef4444', info: '#3b82f6' };
return (
{/* Back Banner */}
← 홈페이지 제작 서비스로 돌아가기
|
SAMPLE · 관리자 대시보드
{/* Sidebar */}
{/* Main */}
{/* Header */}
Overview
2024.08.14 · 오전 10:32 업데이트
{/* KPI Cards */}
{kpis.map((kpi) => (
{kpi.value}
{kpi.up ? '↑' : '↓'} {kpi.change}
))}
{/* Chart + Progress */}
{/* Bar Chart */}
월별 매출 추이
{['1M', '3M', '6M', '1Y'].map((p) => (
))}
{chartData.map((d, i) => (
))}
{/* Progress */}
채널별 전환율
{[
{ label: 'Organic Search', val: 78, color: '#3b82f6' },
{ label: 'Direct', val: 55, color: '#10b981' },
{ label: 'Social Media', val: 42, color: '#a855f7' },
{ label: 'Email', val: 34, color: '#f59e0b' },
{ label: 'Referral', val: 20, color: '#ec4899' },
].map((p) => (
))}
{/* Activity Table */}
{['사용자', '활동', '시간', '상태'].map((h) => (
| {h} |
))}
{activities.map((a, i) => (
|
{a.user}
|
{a.action}
|
{a.time}
|
|
))}
);
}