package com.example.uitugasakhir.pengaturan

import android.widget.Toast
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
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.platform.LocalContext
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.app.ui.theme.Inria_Regular
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.HorizontalDivider
import androidx.compose.ui.res.stringResource
import androidx.navigation.NavController
import androidx.navigation.Navigation
import com.example.uitugasakhir.R
import com.example.uitugasakhir.ViewModel.MainViewModel




@Composable
fun BantuanCardSection(
    navController: NavController,
    viewModel: MainViewModel
) {

    val context = LocalContext.current

    Text(
        text = stringResource(R.string.help_support),
        fontSize = 15.sp,
        fontFamily = Inria_Regular,
        fontWeight = FontWeight.Medium,
        color = Color.Gray,
        modifier = Modifier
            .fillMaxWidth()
            .padding(horizontal = 28.dp)
    )

    Spacer(modifier = Modifier.height(15.dp))

    Card(
        modifier = Modifier
            .padding(horizontal = 25.dp)
            .size(width = 333.dp, height = 100.dp),
        shape = RoundedCornerShape(24.dp),
        colors = CardDefaults.cardColors(
            containerColor = Color(0xFFEDEDED)
        )
    ) {
        Column(modifier = Modifier.padding(16.dp)) {

            Text(
                text = stringResource(R.string.guide),
                modifier = Modifier.clickable {
                    navController.navigate("panduan")
                }
            )

            Spacer(modifier = Modifier.height(13.dp))

            HorizontalDivider(
                modifier = Modifier.fillMaxWidth()
            )

            Spacer(modifier = Modifier.height(13.dp))

            Text(
                text = stringResource(R.string.contact_developer),
                modifier = Modifier.clickable {
                    Toast.makeText(context, "Hubungi developer", Toast.LENGTH_SHORT).show()
                }
            )
        }
    }

}