package com.tt.honeyDue.platform

import androidx.compose.runtime.Composable

data class ImageData(
    val bytes: ByteArray,
    val fileName: String
) {
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other == null || this::class != other::class) return false

        other as ImageData

        if (!bytes.contentEquals(other.bytes)) return false
        if (fileName != other.fileName) return false

        return true
    }

    override fun hashCode(): Int {
        var result = bytes.contentHashCode()
        result = 31 * result + fileName.hashCode()
        return result
    }
}

@Composable
expect fun rememberImagePicker(
    onImagesPicked: (List<ImageData>) -> Unit
): () -> Unit

@Composable
expect fun rememberCameraPicker(
    onImageCaptured: (ImageData) -> Unit
): () -> Unit
