package id.ac.ubharajaya.panicbutton

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.*
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp

class EvacuationMapDetailActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val which = intent.getStringExtra("which") ?: "selatan"
        val resId = if (which == "selatan") R.drawable.lantai_1_selatan else R.drawable.lantai_1_utara
        setContent {
            MaterialTheme {
                EvacuationMapDetailContent(resId)
            }
        }
    }
}

@Composable
fun EvacuationMapDetailContent(drawableResId: Int) {
    Column(modifier = Modifier.fillMaxSize().padding(12.dp)) {
        Text(text = "Detail Peta", modifier = Modifier.padding(bottom = 12.dp))
        Image(painter = painterResource(id = drawableResId), contentDescription = "Map Detail", modifier = Modifier.fillMaxWidth().heightIn(max = 800.dp))
    }
}
