@Composable
fun MessageCard(msg: Message) {
Row(modifier = Modifier.padding(all = 8.dp)) {
Image(
painter = painterResource(id = R.drawable.dummyload),
contentDescription = "O descriere pentru accessibility",
modifier = Modifier
// set image size to 40 dp
.size(120.dp)
// Clip image to be shaped as a circle
.clip(CircleShape)
)
// ad a horizontal space between the image and the column
Spacer(modifier = Modifier.width(8.dp))
Column {
Text(text = msg.author)
// add a vertical space between author and message
Spacer(modifier = Modifier.height(4.dp))
Text(text = msg.body)
}
}
}