package com.zaojiao.app.feat.home.course

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import com.zaojiao.app.feat.home.R
import com.zaojiao.component.common.Spacer

@Composable
internal fun HomeCourseZone() {
    Row(
        modifier = Modifier
            .padding(vertical = 14.dp, horizontal = 16.dp)
            .wrapContentHeight()
            .fillMaxWidth(),
    ) {
        HomeCourseZoneOne()
        Spacer(width = 10.dp)
        HomeCourseZoneZero()
    }
}

@Composable
private fun RowScope.HomeCourseZoneOne() {
    Image(
        painter = painterResource(id = R.mipmap.course_zone1),
        modifier = Modifier
            .weight(1f)
            .aspectRatio(166f / 72f),
        contentDescription = "特惠启蒙",
    )
}

@Composable
private fun RowScope.HomeCourseZoneZero() {
    Image(
        painter = painterResource(id = R.mipmap.course_zone0),
        modifier = Modifier
            .weight(1f)
            .aspectRatio(166f / 72f),
        contentDescription = "0元免费学",
    )
}