package net.buzzert.kordophonedroid.ui.conversationlist

import androidx.annotation.DrawableRes
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.material.Button
import androidx.compose.material.Icon
import androidx.compose.material.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.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.em

@Composable
fun NoContentView(
    @DrawableRes icon: Int,
    text: String,
    onSettings: () -> Unit,
    modifier: Modifier = Modifier,
) {
    Column(
        modifier = modifier
            .fillMaxWidth()
            .fillMaxHeight(),
        verticalArrangement = Arrangement.Center,
        horizontalAlignment = Alignment.CenterHorizontally,
    ) {
        Icon(
            painter = painterResource(icon),
            "server icon",
            modifier = Modifier
                .height(150.dp)
                .width(150.dp)
                .alpha(0.5F)
        )

        Spacer(Modifier)

        Text(
            text = text,
            fontSize = 5.0.em,
            modifier = Modifier
                .alpha(0.5F)
        )

        Spacer(modifier = Modifier.height(24.dp))

        Button(onClick = onSettings) {
            Text("Settings")
        }
    }
}

