class DurationFormatMixin {
  static String formatDuration(int seconds) {
    if (seconds >= 3600) {
      final hours = (seconds / 3600).floor();
      final remainingMinutes = ((seconds % 3600) / 60).floor();
      final remainingSeconds = seconds % 60;
      return '$hours h ${remainingMinutes}m ${remainingSeconds}s';
    } else if (seconds >= 60) {
      final minutes = (seconds / 60).floor();
      final remainingSeconds = seconds % 60;
      return '$minutes m ${remainingSeconds}s';
    }
    return '${seconds}s';
  }
}
