/**
 * 用户增长数据模拟
 */

import type { UserGrowthData } from '../admin/dashboard'

// 生成最近30天的日期
const generateDates = () => {
  const dates: string[] = []
  const today = new Date()
  for (let i = 29; i >= 0; i--) {
    const date = new Date(today)
    date.setDate(date.getDate() - i)
    dates.push(date.toLocaleDateString('zh-CN', { month: '2-digit', day: '2-digit' }))
  }
  return dates
}

// 生成模拟数据
const generateData = (base: number, variance: number) => {
  return Array.from({ length: 30 }, () => 
    base + Math.floor(Math.random() * variance * 2 - variance)
  )
}

const mockData: UserGrowthData = {
  dates: generateDates(),
  newUsers: generateData(50, 20),
  activeUsers: generateData(300, 50)
}

export default mockData
