package com.zaojiao.app.feat.home.index

import android.util.Log
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import com.zaojiao.app.feat.home.R

@Composable
fun HomeIndexActionBar() {
    Box(
        modifier = Modifier
            .padding(vertical = 10.dp)
            .aspectRatio(375f / 170f)
            .fillMaxSize()
    ) {
        Image(
            painter = painterResource(id = R.mipmap.index_actions),
            contentDescription = "首页按钮区",
            modifier = Modifier.fillMaxSize(),
            contentScale = ContentScale.Fit,
        )
        Row(
            modifier = Modifier
                .padding(horizontal = 16.dp)
                .fillMaxSize(),
        ) {
            Box(
                modifier = Modifier
                    .clickable {
                        Log.d("xxxxxxx", "HomeIndexActionBar: 逻辑狗游戏中心")
                    }
                    .weight(1f)
                    .fillMaxHeight()
            )
            Box(
                modifier = Modifier
                    .weight(1f)
                    .fillMaxHeight()
            ) {
                Column(
                    modifier = Modifier.fillMaxSize()
                ) {
                    Box(
                        modifier = Modifier
                            .clickable {
                                Log.d("xxxxxxx", "HomeIndexActionBar: 爆款专区")
                            }
                            .weight(1f)
                            .fillMaxWidth()
                    )
                    Box(
                        modifier = Modifier
                            .clickable {
                                Log.d("xxxxxxx", "HomeIndexActionBar: 商城中心")
                            }
                            .weight(1f)
                            .fillMaxWidth()
                    )
                }
            }
        }
    }
}