improve checked in guest ui

This commit is contained in:
androidlover5842
2026-01-29 20:14:14 +05:30
parent dffa8b14cd
commit f593306c50
3 changed files with 24 additions and 5 deletions

View File

@@ -37,6 +37,9 @@ data class BookingListItem(
val id: String? = null,
val status: String? = null,
val guestId: String? = null,
val guestName: String? = null,
val guestPhone: String? = null,
val roomNumbers: List<Int> = emptyList(),
val source: String? = null,
val checkInAt: String? = null,
val checkOutAt: String? = null,

View File

@@ -174,10 +174,23 @@ private fun CheckedInBookingCard(
)
) {
Column(modifier = Modifier.padding(12.dp)) {
Text(
text = booking.id?.take(8)?.let { "Booking #$it" } ?: "Booking",
style = MaterialTheme.typography.titleSmall
)
val guestName = booking.guestName?.takeIf { it.isNotBlank() }
if (guestName == null) {
Text(
text = booking.id?.take(8)?.let { "Booking #$it" } ?: "Booking",
style = MaterialTheme.typography.titleSmall
)
}
if (guestName != null) {
Text(text = guestName, style = MaterialTheme.typography.bodyMedium)
}
if (booking.roomNumbers.isNotEmpty()) {
Text(
text = booking.roomNumbers.joinToString(", "),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant
)
}
val source = booking.source?.takeIf { it.isNotBlank() }
if (source != null) {
Text(text = source, style = MaterialTheme.typography.bodySmall)