package com.aiosman.riderpro

import androidx.annotation.DrawableRes
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.LocationOn
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.focusModifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

@Composable
fun AddPage(){
    val navController = LocalNavController.current
    Column(modifier = Modifier
        .fillMaxSize()
        .background(Color.Black)) {
        AddBtn(icon = R.drawable.rider_pro_icon_rider_share, text = "Rider Share") {
            NewPostViewModel.asNewPost()
            navController.navigate("NewPost")
        }
        AddBtn(icon = R.drawable.rider_pro_location_create, text = "Location Create")
    }
}

@Composable
fun AddBtn(@DrawableRes icon: Int, text: String,onClick: (() -> Unit)? = {}){
    Row (modifier = Modifier
        .fillMaxWidth().padding(24.dp).clickable {
            onClick?.invoke()
        },
        verticalAlignment = Alignment.CenterVertically){
        Image(
            modifier = Modifier.size(40.dp),
            painter = painterResource(id = icon), contentDescription = null)
        Text(modifier = Modifier.padding(start = 24.dp),text = text, color = Color.White,fontSize = 22.sp, style = TextStyle(fontWeight = FontWeight.Bold))
    }
}