package com.aiosman.riderpro

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

@Preview
@Composable
fun FollowerPage() {
    StatusBarMaskLayout(
        modifier = Modifier.padding(horizontal = 16.dp)
    ) {
        NoticeScreenHeader("FOLLOWERS")
        Spacer(modifier = Modifier.height(28.dp))
        LazyColumn(
            modifier = Modifier.weight(1f)
        ) {
            item {
                repeat(20) {
                    FollowerItem()
                }
            }
        }
    }
}


@Composable
fun FollowerItem() {
    Box(
        modifier = Modifier.padding(horizontal = 24.dp, vertical = 16.dp)
    ) {
        Row(
            modifier = Modifier.fillMaxWidth(),
            verticalAlignment = Alignment.CenterVertically,
        ) {
            Image(
                painter = painterResource(id = R.drawable.default_avatar),
                contentDescription = "Follower",
                modifier = Modifier.size(40.dp)
            )
            Spacer(modifier = Modifier.width(12.dp))
            Column(
                modifier = Modifier.weight(1f)
            ) {
                Text("Username", fontWeight = FontWeight.Bold, fontSize = 16.sp)
                Spacer(modifier = Modifier.height(5.dp))
                Text("Username", fontSize = 12.sp, color = Color(0x99000000))
            }
            Box {
                Image(
                    painter = painterResource(id = R.drawable.follow_bg),
                    contentDescription = "Like",
                    modifier = Modifier
                        .width(79.dp)
                        .height(24.dp)
                )
                Text(
                    "FOLLOW",
                    fontSize = 14.sp,
                    color = Color(0xFFFFFFFF),
                    modifier = Modifier.align(
                        Alignment.Center
                    )
                )
            }

        }
    }
}