import '../models/activity.dart';

class ActivityService {
  static List<Activity> mockActivities = [
    Activity(
      id: '1',
      title: '人民公园晨练太极',
      category: '太极',
      time: DateTime.now().add(Duration(days: 1, hours: 6)),
      location: '人民公园东门',
      maxParticipants: 15,
      currentParticipants: 8,
      creatorName: '张大爷',
      description: '每周三次的太极晨练，欢迎新朋友加入',
    ),
    Activity(
      id: '2',
      title: '锦江畔摄影采风',
      category: '摄影',
      time: DateTime.now().add(Duration(days: 2, hours: 14)),
      location: '锦江绿道',
      maxParticipants: 10,
      currentParticipants: 5,
      creatorName: '李阿姨',
      description: '春天来了，一起拍拍花儿',
    ),
    Activity(
      id: '3',
      title: '茶馆品茶会',
      category: '茶艺',
      time: DateTime.now().add(Duration(days: 3, hours: 15)),
      location: '宽窄巷子茶馆',
      maxParticipants: 8,
      currentParticipants: 3,
      creatorName: '王老师',
      description: '品茶聊天，结交新朋友',
    ),
  ];

  static List<String> categories = [
    '全部', '太极', '晨练', '书法', '摄影', '舞蹈', '旅游', '茶艺', '手工', '唱歌', '棋牌'
  ];
  
  static List<Activity> getActivities({String? category}) {
    if (category == null || category == '全部') {
      return mockActivities;
    }
    return mockActivities.where((a) => a.category == category).toList();
  }
  
  static void addActivity(Activity activity) {
    mockActivities.add(activity);
  }
}
