package com.adealink.weparty.util

import android.app.Activity
import com.adealink.frame.router.Router
import com.adealink.weparty.module.image.Image
import com.adealink.weparty.module.image.Image.Preview.Companion.KEY_CURRENT_INDEX
import com.adealink.weparty.module.image.Image.Preview.Companion.KEY_IMAGE_URI_LIST
import com.adealink.weparty.module.image.Image.Preview.Companion.KEY_OWNER_UID
import com.adealink.weparty.module.image.Video
import com.adealink.weparty.module.image.data.VideoItem

fun goImagePreviewActivity(
    activity: Activity,
    imageUriList: ArrayList<String>,
    currentIndex: Int = 0,
    ownerUid: String = "",
) {
    Router.build(activity, Image.Preview.PATH)
        .putStringArrayListExtra(KEY_IMAGE_URI_LIST, imageUriList)
        .putExtra(KEY_CURRENT_INDEX, currentIndex)
        .putExtra(KEY_OWNER_UID, ownerUid)
        .start()
}

fun goVideoPreviewActivity(
    activity: Activity,
    videoList: ArrayList<VideoItem>,
    currentIndex: Int = 0,
    ownerUid: String = "",
) {
    Router.build(activity, Video.Preview.PATH)
        .putParcelableArrayListExtra(Video.Preview.KEY_VIDEO_LIST, videoList)
        .putExtra(Video.Preview.KEY_CURRENT_INDEX, currentIndex)
        .putExtra(Video.Preview.KEY_OWNER_UID, ownerUid)
        .start()
}