import 'package:flutter/material.dart';
import 'package:shadcn_ui/shadcn_ui.dart';

import 'app_colors.dart';

enum AppModule {
  ai,
  health,
  medication,
  exercise,
  report,
  diet,
  device,
  notification,
  doctor,
  calendar,
  followup,
}

class AppModuleVisual {
  final AppModule module;
  final String label;
  final IconData icon;
  final Color color;
  final Color lightColor;
  final Color borderColor;
  final LinearGradient gradient;

  const AppModuleVisual({
    required this.module,
    required this.label,
    required this.icon,
    required this.color,
    required this.lightColor,
    required this.borderColor,
    required this.gradient,
  });
}

class AppModuleVisuals {
  AppModuleVisuals._();

  static const ai = AppModuleVisual(
    module: AppModule.ai,
    label: 'AI',
    icon: LucideIcons.bot,
    color: AppColors.primary,
    lightColor: AppColors.primarySoft,
    borderColor: AppColors.primaryLight,
    gradient: AppColors.primaryGradient,
  );

  static const health = AppModuleVisual(
    module: AppModule.health,
    label: '健康',
    icon: LucideIcons.heartPulse,
    color: AppColors.health,
    lightColor: AppColors.healthLight,
    borderColor: AppColors.healthBorder,
    gradient: AppColors.healthGradient,
  );

  static const medication = AppModuleVisual(
    module: AppModule.medication,
    label: '用药',
    icon: LucideIcons.pill,
    color: AppColors.medication,
    lightColor: AppColors.medicationLight,
    borderColor: AppColors.medicationBorder,
    gradient: AppColors.medicationGradient,
  );

  static const exercise = AppModuleVisual(
    module: AppModule.exercise,
    label: '运动',
    icon: LucideIcons.footprints,
    color: AppColors.exercise,
    lightColor: AppColors.exerciseLight,
    borderColor: AppColors.exerciseBorder,
    gradient: AppColors.exerciseGradient,
  );

  static const report = AppModuleVisual(
    module: AppModule.report,
    label: '报告',
    icon: LucideIcons.fileText,
    color: AppColors.report,
    lightColor: AppColors.reportLight,
    borderColor: AppColors.reportBorder,
    gradient: AppColors.reportGradient,
  );

  static const diet = AppModuleVisual(
    module: AppModule.diet,
    label: '饮食',
    icon: LucideIcons.utensils,
    color: AppColors.diet,
    lightColor: AppColors.dietLight,
    borderColor: AppColors.dietBorder,
    gradient: AppColors.dietGradient,
  );

  static const device = AppModuleVisual(
    module: AppModule.device,
    label: '设备',
    icon: LucideIcons.bluetooth,
    color: AppColors.device,
    lightColor: AppColors.deviceLight,
    borderColor: AppColors.deviceBorder,
    gradient: AppColors.deviceGradient,
  );

  static const notification = AppModuleVisual(
    module: AppModule.notification,
    label: '通知',
    icon: LucideIcons.bell,
    color: AppColors.notification,
    lightColor: AppColors.notificationLight,
    borderColor: AppColors.notificationBorder,
    gradient: AppColors.notificationGradient,
  );

  static const doctor = AppModuleVisual(
    module: AppModule.doctor,
    label: '医生',
    icon: LucideIcons.stethoscope,
    color: AppColors.doctor,
    lightColor: AppColors.doctorLight,
    borderColor: AppColors.doctorBorder,
    gradient: AppColors.doctorCareGradient,
  );

  static const calendar = AppModuleVisual(
    module: AppModule.calendar,
    label: '日历',
    icon: LucideIcons.calendarDays,
    color: AppColors.calendar,
    lightColor: AppColors.calendarLight,
    borderColor: AppColors.calendarBorder,
    gradient: AppColors.calendarGradient,
  );

  static const followup = AppModuleVisual(
    module: AppModule.followup,
    label: '随访',
    icon: LucideIcons.calendarCheck,
    color: AppColors.followup,
    lightColor: AppColors.followupLight,
    borderColor: AppColors.followupBorder,
    gradient: AppColors.followupGradient,
  );

  static const values = <AppModule, AppModuleVisual>{
    AppModule.ai: ai,
    AppModule.health: health,
    AppModule.medication: medication,
    AppModule.exercise: exercise,
    AppModule.report: report,
    AppModule.diet: diet,
    AppModule.device: device,
    AppModule.notification: notification,
    AppModule.doctor: doctor,
    AppModule.calendar: calendar,
    AppModule.followup: followup,
  };

  static AppModuleVisual of(AppModule module) => values[module] ?? ai;
}
