import 'package:flutter/material.dart';

import '../../../providers/danmaku_settings_provider.dart';
import '../../../providers/appearance_provider.dart';
import '../../../providers/tmdb_settings_provider.dart';

String formatMenuSpeed(double v) {
  return '${v.toStringAsFixed(2)}X';
}

String themeModeLabel(ThemeMode mode) => switch (mode) {
  ThemeMode.system => '跟随系统',
  ThemeMode.light => '亮色',
  ThemeMode.dark => '暗色',
};

String headerModeLabel(HeaderMode mode) => switch (mode) {
  HeaderMode.solid => '纯色',
  HeaderMode.frosted => '磨砂',
};

String startupPageLabel(StartupPage page) => switch (page) {
  StartupPage.home => '首页',
  StartupPage.servers => '服务器',
  StartupPage.aggregated => '聚合视界',
  StartupPage.discover => '发现',
  StartupPage.settings => '设置',
};

String audioLangLabel(String lang) => switch (lang) {
  'chi' => '中文',
  'eng' => '英语',
  'jpn' => '日语',
  _ => '默认',
};

String chineseConvertLabel(ChineseConvertMode mode) => switch (mode) {
  ChineseConvertMode.none => '不转换',
  ChineseConvertMode.toSimplified => '转简体',
  ChineseConvertMode.toTraditional => '转繁体',
};

String tmdbAccessModeLabel(TmdbAccessMode mode) => switch (mode) {
  TmdbAccessMode.official => '官方 TMDB',
  TmdbAccessMode.smAccount => '内置代理（sm-server）',
};

String tmdbAuthModeLabel(TmdbAuthMode mode) => switch (mode) {
  TmdbAuthMode.apiKey => 'API Key',
  TmdbAuthMode.bearer => 'Bearer Token',
};

String tmdbLanguageLabel(String lang) => switch (lang) {
  'zh-CN' => '简体中文',
  'zh-TW' => '繁体中文',
  'en-US' => '英语',
  'ja-JP' => '日语',
  'ko-KR' => '韩语',
  _ => lang,
};
