package com.approagency.pharmacy.presentation.common

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.window.Dialog
import com.vada.caller.ui.theme.dime

@Composable
fun CustomModalDialog(
    onDismissRequest: () -> Unit,
    modifier: Modifier = Modifier,
    content: @Composable ColumnScope.() -> Unit
) {
    Dialog(
        onDismissRequest = onDismissRequest
    ){
        Surface(
            modifier = modifier
                .wrapContentHeight(),
            shape = MaterialTheme.shapes.medium,
            color = MaterialTheme.colorScheme.surface,
            tonalElevation = MaterialTheme.dime.sm
        ) {
            Column(
                modifier = Modifier
                    .padding(MaterialTheme.dime.lg),
                verticalArrangement = Arrangement.spacedBy(MaterialTheme.dime.lg),
                content = content
            )
        }
    }
}