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

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.zaojiao.component.common.PageState
import com.zaojiao.component.common.Spacer
import com.zaojiao.component.common.StatePage
import com.zaojiao.component.common.grid

@OptIn(ExperimentalFoundationApi::class)
@Composable
fun HomeCoursePage() {
    Surface(
        color = Color.White,
        modifier = Modifier.fillMaxSize(),
    ) {
        StatePage(state = PageState.Success) {
            LazyColumn(
                modifier = Modifier.fillMaxWidth()
            ) {
                stickyHeader {
                    HomeCourseTopBar()
                }

                item {
                    HomeCourseTopSwiper()
                }

                item {
                    HomeCourseCategory()
                }

                item {
                    HomeCourseZone()
                }

                item {
                    HomeCourseGroupBuy()
                }

                item {
                    HomeCourseRecommend()
                }

                grid(
                    count = 100,
                    span = 2,
                    hSpace = 12.dp,
                    vSpace = 20.dp,
                    padding = 16.dp,
                    isVertical = true,
                ) {
                    HomeCourseRecommendItem()
                }
            }
        }
    }
}