import 'package:get/get.dart';
import 'package:tone_snap/data/enum/music_type.dart';
import 'package:tone_snap/data/models/music_model.dart';
import 'package:tone_snap/routes/app_routes.dart';

class SearchResultChildOptimumController extends GetxController {
  void onTapItem(MusicModel musicModel) {
    if (musicModel.musicType == MusicType.musicVideoTypeAtv.name) {
      Get.toNamed(AppRoutes.playPage, arguments: {
        'videoId': musicModel.videoId,
        'playlistId': musicModel.playlistId,
      });
    } else if (musicModel.musicType == MusicType.musicPageTypeAlbum.name
        || musicModel.musicType == MusicType.musicPageTypePlaylist.name) {
      Get.toNamed(AppRoutes.albumSongList, arguments: {
        'browseId': musicModel.browseId,
        'params': musicModel.params,
        'coverUrl': musicModel.coverUrl,
        'title': musicModel.title,
        'subtitle': musicModel.subtitle,
      });
    }
  }
}
