When to use it
The host authorizes and runs the operation, then updates status. Both buttons disable once decided.
Ask for an approve or reject decision on an application-owned request.
Native example
The host authorizes and runs the operation, then updates status. Both buttons disable once decided.
import androidx.compose.material3.Text
import androidx.compose.runtime.*
import com.santi020k.lumen.*
@Composable
fun DeleteApprovalExample(deleteProjects: () -> Unit) {
var status by remember { mutableStateOf(LumenApprovalStatus.Pending) }
LumenApprovalCard(
label = "Delete 3 archived projects?",
requestId = "request-42",
statusLabel = when (status) {
LumenApprovalStatus.Pending -> "Waiting for your decision"
LumenApprovalStatus.Approved -> "Approved"
LumenApprovalStatus.Rejected -> "Rejected. Nothing was deleted."
},
status = status,
onResponse = { _, response ->
if (response == LumenApprovalResponse.Approve) {
deleteProjects()
status = LumenApprovalStatus.Approved
} else {
status = LumenApprovalStatus.Rejected
}
}
) {
Text("The assistant wants to permanently delete Atlas, Beacon, and Comet.")
}
}Reference
The primary shared and platform-specific options exposed by LumenApprovalCard.
| API | Values or type | Default | Description |
|---|---|---|---|
| requestId / status / onResponse | request identity / decision / response callback | required / pending / required | The host authorizes and runs the operation, then updates status. |
Native behavior
The host authorizes and runs the operation, then updates status. Both buttons disable once decided.
Card named by its label; decision status announced politely.
Shared component