package com.ar.artraceartpro.viewmodel;

import android.app.Application;

import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;

import com.ar.artraceartpro.data.local.entity.ImageData;
import com.ar.artraceartpro.data.repository.ImageRepository;

import java.util.List;

public class ImageViewModel extends AndroidViewModel {

    private final ImageRepository imageRepository;

    public ImageViewModel(Application application) {
        super(application);
        imageRepository = new ImageRepository(application);
    }

    public LiveData<List<ImageData>> getFirstCategory(List<String> categories) {
        return imageRepository.getFirstCategory(categories);
    }

    public LiveData<List<ImageData>> getRecommend(String name, int index) {
        return imageRepository.getRecommend(name,index);
    }

    public LiveData<List<ImageData>> getAllFavorite(){
        return imageRepository.getAllFavorite();
    }

    public LiveData<List<ImageData>> getAllImportLive(){
        return imageRepository.getAllImportLive();
    }

    public void insert(ImageData imageData) {
        imageRepository.insert(imageData);
    }

    public List<ImageData> getAllImport() {
        return imageRepository.getAllImport();
    }

    public LiveData<List<ImageData>> getAllCategory(String name) {
        return imageRepository.getAllCategory(name);
    }
}
