package com.isidroid.c23.ui._component

import android.net.Uri
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect

@Composable
fun PickGalleryComponent(
    hash: String,
    onPictureReady: (List<Uri>) -> Unit,
    type: String = "image/*"
) {
    val launcher = rememberLauncherForActivityResult(ActivityResultContracts.GetMultipleContents()) { uris ->
        onPictureReady(uris)
    }

    LaunchedEffect(hash) { launcher.launch(type) }
}