package com.tt.honeyDue.platform

import androidx.compose.runtime.Composable
import com.tt.honeyDue.models.Residence

/**
 * State holder for residence sharing operation.
 */
data class ResidenceSharingState(
    val isLoading: Boolean = false,
    val error: String? = null
)

/**
 * Returns a pair of state and a function to share a residence.
 * The function will:
 * 1. Call the backend to generate a share code
 * 2. Create a .honeydue file with the share package
 * 3. Open the native share sheet
 *
 * @return Pair of (state, shareFunction)
 */
@Composable
expect fun rememberShareResidence(): Pair<ResidenceSharingState, (Residence) -> Unit>
