package com.prodhack.moscow2025.presentation.utils.ui

import androidx.compose.material3.SnackbarDuration
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.SnackbarVisuals

enum class SnackbarStyle {
	Success,
	Error,
}

data class AppSnackbarVisuals(
	override val message: String,
	override val actionLabel: String? = null,
	override val withDismissAction: Boolean = false,
	override val duration: SnackbarDuration = SnackbarDuration.Short,
	val style: SnackbarStyle = SnackbarStyle.Error
) : SnackbarVisuals

suspend fun SnackbarHostState.showSnackbar(
	message: String,
	style: SnackbarStyle,
	actionLabel: String? = null,
	withDismissAction: Boolean = false,
	duration: SnackbarDuration = SnackbarDuration.Short
) = showSnackbar(
	AppSnackbarVisuals(
		message = message,
		actionLabel = actionLabel,
		withDismissAction = withDismissAction,
		duration = duration,
		style = style
	)
)
