package com.example.wabi.view.screeens.onboard.items

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.unit.dp
import com.example.wabi.ui.theme.WabiTheme
import com.example.wabi.view.components.texts.HeaderText
import com.example.wabi.view.components.texts.MainText

@Composable
fun PartSlider(onboardItem: OnboardListState, modifier: Modifier = Modifier) {
    Column(
        modifier = modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally
    ) {
        Column(
            modifier = modifier
                .weight(0.6f)
                .background(color = WabiTheme.colors.onBoardLight)
                .fillMaxWidth(),
            verticalArrangement = Arrangement.Center,
            horizontalAlignment = Alignment.CenterHorizontally
        ) {
            Image(
                imageVector = ImageVector.vectorResource(onboardItem.image),
                contentDescription = "onboardItem",
            )
        }
        Column(
            modifier = modifier
                .weight(0.2f)
                .background(color = WabiTheme.colors.onBoardDark)
                .fillMaxWidth()
                .verticalScroll(rememberScrollState()),
            horizontalAlignment = Alignment.CenterHorizontally,
            verticalArrangement = Arrangement.SpaceAround
        ) {
            HeaderText(
                text = onboardItem.title,
                color = WabiTheme.colors.accentColorOne,
                maxLines = 1,
                minLines = 1
            )
            MainText(
                text = onboardItem.mainText,
                modifier = Modifier.padding(50.dp, 0.dp),
                color = WabiTheme.colors.onBoardLight
            )
        }
    }
}