package com.example.myapplication.database.entities.composeui

import androidx.lifecycle.ViewModel
import androidx.paging.PagingData
import com.example.myapplication.database.entities.model.Bike
import com.example.myapplication.database.entities.repository.BikeRepository
import kotlinx.coroutines.flow.Flow

class BikeListViewModel(
    private val bikeRepository: BikeRepository
) : ViewModel() {
    val bikeListUiState: Flow<PagingData<Bike>> = bikeRepository.getAllBikes()

    suspend fun deleteBike(bike: Bike) {
        bikeRepository.deleteBike(bike)
    }
}