package com.suno.android.ui.bottom_sheets.song_actions import androidx.annotation.DrawableRes import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.alpha import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.semantics.disabled import androidx.compose.ui.semantics.semantics import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.suno.android.common_ui.R import com.suno.android.common_ui.theme.ExtendedTheme import com.suno.android.common_ui.theme.SunoTheme @Composable fun SongVerticalAction( text: String, @DrawableRes iconRes: Int, foregroundColor: Color = ExtendedTheme.colors.textPrimary, disabled: Boolean? = null, onClick: () -> Unit, ) { Column( modifier = Modifier .fillMaxWidth() .semantics(mergeDescendants = true) { if (disabled == true) { disabled() } } .padding(16.dp) .alpha(if (disabled == true) 0.5f else 1f) .clickable( enabled = disabled != true, onClick = onClick, ), verticalArrangement = Arrangement.spacedBy(8.dp), horizontalAlignment = Alignment.CenterHorizontally, ) { Icon(painter = painterResource(iconRes), contentDescription = null, tint = foregroundColor) Text(text, style = ExtendedTheme.typography.smallBody, color = foregroundColor) } } @Preview @Composable private fun SongVerticalAction_Card_Preview() { SunoTheme { Column { SongVerticalAction( text = "Click me", iconRes = R.drawable.plus, ) { } } } }