@@ -104,7 +104,7 @@ fun AlertsScreen(
104 contentPadding = PaddingValues(16.dp),
104 contentPadding = PaddingValues(16.dp),
105 verticalArrangement = Arrangement.spacedBy(8.dp),
105 verticalArrangement = Arrangement.spacedBy(8.dp),
107− itemsIndexed(state.alerts, key = { index, alert -> alert.id ?: alert.name ?: "alert_$index" }) { _, alert ->
107+ itemsIndexed(state.alerts, key = { index, alert -> alert.id ?: "alert_$index" }) { _, alert ->
108 AlertCard(
108 AlertCard(
109 alert = alert,
109 alert = alert,
110 onDelete = if (alert.id != null) {
110 onDelete = if (alert.id != null) {
@@ -124,7 +124,7 @@ fun AlertsScreen(
124 onDismissRequest = viewModel::cancelDelete,
124 onDismissRequest = viewModel::cancelDelete,
125 title = { Text("Delete Alert") },
125 title = { Text("Delete Alert") },
127− Text("Are you sure you want to delete \"${alert.name ?: "this alert"}\"? This action cannot be undone.")
127+ Text("Are you sure you want to delete \"${alert.displayName}\"? This action cannot be undone.")
129 confirmButton = {
129 confirmButton = {
130 TextButton(
130 TextButton(
@@ -165,10 +165,10 @@ private fun AlertCard(alert: Alert, onDelete: (() -> Unit)?) {
165 modifier = Modifier.weight(1f),
165 modifier = Modifier.weight(1f),
168− if (alert.enabled == true) Icons.Filled.NotificationsActive
168+ if (alert.isEnabled) Icons.Filled.NotificationsActive
169 else Icons.Filled.NotificationsOff,
169 else Icons.Filled.NotificationsOff,
170− contentDescription = if (alert.enabled == true) "Alert enabled" else "Alert disabled",
170+ contentDescription = if (alert.isEnabled) "Alert enabled" else "Alert disabled",
171− tint = if (alert.enabled == true) {
171+ tint = if (alert.isEnabled) {
172 MaterialTheme.colorScheme.primary
172 MaterialTheme.colorScheme.primary
174 MaterialTheme.colorScheme.onSurfaceVariant
174 MaterialTheme.colorScheme.onSurfaceVariant
@@ -177,17 +177,20 @@ private fun AlertCard(alert: Alert, onDelete: (() -> Unit)?) {
178 Spacer(modifier = Modifier.width(8.dp))
178 Spacer(modifier = Modifier.width(8.dp))
180− text = alert.name ?: "Unnamed Alert",
180+ text = alert.displayName,
181 style = MaterialTheme.typography.titleMedium,
181 style = MaterialTheme.typography.titleMedium,
182 fontWeight = FontWeight.SemiBold,
182 fontWeight = FontWeight.SemiBold,
185 Row(verticalAlignment = Alignment.CenterVertically) {
185 Row(verticalAlignment = Alignment.CenterVertically) {
186− if (alert.enabled != null) {
186+ val stateLabel = alert.state ?: if (alert.enabled != null) {
187+ if (alert.enabled) "Enabled" else "Disabled"
189+ if (stateLabel != null) {
188− text = if (alert.enabled) "Enabled" else "Disabled",
191+ text = stateLabel,
189 style = MaterialTheme.typography.labelSmall,
192 style = MaterialTheme.typography.labelSmall,
190− color = if (alert.enabled) {
193+ color = if (alert.isEnabled) {
191 MaterialTheme.colorScheme.primary
194 MaterialTheme.colorScheme.primary
193 MaterialTheme.colorScheme.onSurfaceVariant
196 MaterialTheme.colorScheme.onSurfaceVariant
@@ -220,10 +223,20 @@ private fun AlertCard(alert: Alert, onDelete: (() -> Unit)?) {
223− if (alert.stream != null) {
226+ val streamText = alert.streamDisplay
227+ if (streamText != null) {
224 Spacer(modifier = Modifier.height(4.dp))
228 Spacer(modifier = Modifier.height(4.dp))
226− text = "Stream: ${alert.stream}",
230+ text = "Stream: $streamText",
231+ style = MaterialTheme.typography.labelMedium,
232+ color = MaterialTheme.colorScheme.onSurfaceVariant,
236+ if (alert.severity != null) {
237+ Spacer(modifier = Modifier.height(4.dp))
239+ text = "Severity: ${alert.severity}",
227 style = MaterialTheme.typography.labelMedium,
240 style = MaterialTheme.typography.labelMedium,
228 color = MaterialTheme.colorScheme.onSurfaceVariant,
241 color = MaterialTheme.colorScheme.onSurfaceVariant,
@@ -234,7 +247,16 @@ private fun AlertCard(alert: Alert, onDelete: (() -> Unit)?) {
234 HorizontalDivider()
247 HorizontalDivider()
235 Spacer(modifier = Modifier.height(8.dp))
248 Spacer(modifier = Modifier.height(8.dp))
250+ if (alert.alertType != null) {
252+ text = "Type: ${alert.alertType}",
253+ style = MaterialTheme.typography.bodySmall,
254+ color = MaterialTheme.colorScheme.onSurfaceVariant,
237 if (alert.rule != null) {
258 if (alert.rule != null) {
259+ Spacer(modifier = Modifier.height(4.dp))
239 text = "Rule:",
261 text = "Rule:",
240 style = MaterialTheme.typography.labelMedium,
262 style = MaterialTheme.typography.labelMedium,