package com.tt.honeyDue.platform

import androidx.compose.runtime.Composable

/**
 * Result of a biometric authentication attempt.
 */
sealed class BiometricResult {
    /** Authentication succeeded */
    data object Success : BiometricResult()
    /** Authentication failed (wrong biometric, cancelled, etc.) */
    data class Failed(val message: String) : BiometricResult()
    /** Biometric hardware not available on this device */
    data object NotAvailable : BiometricResult()
}

/**
 * Interface for biometric authentication operations.
 */
interface BiometricAuthPerformer {
    /** Check if biometric authentication is available on this device */
    fun isBiometricAvailable(): Boolean

    /** Trigger biometric authentication with the given reason string */
    fun authenticate(
        title: String,
        subtitle: String,
        onResult: (BiometricResult) -> Unit
    )
}

/**
 * Remember a biometric auth performer for the current platform.
 * Follows the same expect/actual composable pattern as rememberHapticFeedback.
 */
@Composable
expect fun rememberBiometricAuth(): BiometricAuthPerformer
