package com.example.studybuddy.view.panels.topbar


import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarDefaults
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.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavHostController
import com.example.testirovanye_supabase.R
import com.example.triphelper.view.theme.Casagrand

//Данная функция отвечает за отрисовку верхней части экрана - TopAppBar
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun TopBarApp(controller: NavHostController) {
    TopAppBar(
        modifier = Modifier
            .fillMaxWidth(),
        title = {
            Row(
                horizontalArrangement = Arrangement.Center,
                verticalAlignment = Alignment.CenterVertically,
                modifier = Modifier.fillMaxWidth()
            ) {
                Text(
                    text = "TRIP HELPER",
                    fontFamily = Casagrand,
                    fontSize = 32.sp,
                    color = Color(0xFF510B3C)
                )
            }
        },
        navigationIcon = {
            Image(
                painter = painterResource(id = R.drawable.logotriphelper_backround),
                contentDescription = null,
                modifier = Modifier.height(40.dp).width(60.dp)
            )
        },
        actions = {
            Image(
                painter = painterResource(id = R.drawable.logotriphelper_backround),
                contentDescription = null,
                modifier = Modifier.height(40.dp).width(60.dp)
            )
        },
        colors = TopAppBarDefaults.topAppBarColors(
            containerColor = Color.Transparent
        )
    )
}