import 'package:electronic_assistant/popup/agenda_time_popup.dart';
import 'package:electronic_assistant/resource/string.gen.dart';
import 'package:electronic_assistant/utils/expand.dart';
import 'package:get/get.dart';

String getAgendaFilterTxt(AgendaTimeType type,
    {String? startTime, String? endTime}) {
  String filterTxt;
  switch (type) {
    case AgendaTimeType.nearlyAWeek:
      filterTxt = StringName.popupAgendaFilterTxt.tr
          .replacePlaceholders([StringName.popupNearlyAWeek.tr]);
      break;
    case AgendaTimeType.nearlyTwoWeek:
      filterTxt = StringName.popupAgendaFilterTxt.tr
          .replacePlaceholders([StringName.popupNearlyTwoWeek.tr]);
      break;
    case AgendaTimeType.nearlyAMonth:
      filterTxt = StringName.popupAgendaFilterTxt.tr
          .replacePlaceholders([StringName.popupNearlyAMonth.tr]);
      break;
    case AgendaTimeType.customTime:
      if (startTime == null || endTime == null) {
        filterTxt = StringName.popupAgendaFilterTxt.tr
            .replacePlaceholders([StringName.popupCustomTime.tr]);
      } else {
        filterTxt = StringName.popupAgendaFilterTxt.tr.replacePlaceholders(
            ['${StringName.popupCustomTime.tr} $startTime-$endTime']);
      }
      break;
  }
  return filterTxt;
}
