package com.mhss.app.mybrain.presentation.auth import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Button import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.material3.TextButton 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.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.DialogProperties import com.mhss.app.ui.theme.PrimaryColor @Composable fun LegalTermsDialog( onDismiss: () -> Unit, onAccept: () -> Unit ) { Dialog( onDismissRequest = onDismiss, properties = DialogProperties(usePlatformDefaultWidth = false) ) { Surface( modifier = Modifier .fillMaxWidth(0.94f) .fillMaxHeight(0.85f), shape = RoundedCornerShape(24.dp), color = MaterialTheme.colorScheme.surface, tonalElevation = 6.dp ) { Column( modifier = Modifier .fillMaxWidth() .padding(20.dp) ) { Row( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically ) { Column { Text( text = "Legal Terms and Privacy Policy", style = MaterialTheme.typography.titleLarge.copy(fontWeight = FontWeight.Bold) ) Text( text = "Governed by the Laws of the Republic of India", style = MaterialTheme.typography.labelSmall, color = PrimaryColor ) } } Spacer(Modifier.height(12.dp)) HorizontalDivider(color = MaterialTheme.colorScheme.outline.copy(alpha = 0.2f)) Spacer(Modifier.height(12.dp)) Column( modifier = Modifier .weight(1f) .verticalScroll(rememberScrollState()), verticalArrangement = Arrangement.spacedBy(14.dp) ) { LegalSection( title = "1. Regulatory Framework and Jurisdiction", body = "These Terms of Service and Privacy Policy are drafted in strict compliance with the Information Technology Act, 2000, the Information Technology (Intermediary Guidelines and Digital Media Ethics Code) Rules, 2021, and the Digital Personal Data Protection Act, 2023 (DPDP Act, India). All disputes arising hereunder shall be subject to the exclusive jurisdiction of the competent courts in India." ) LegalSection( title = "2. Telegram Session and Bot Metadata Authorization", body = "When you choose to authenticate via Telegram Session (MTProto), your session credentials are encrypted in transit and at rest using industry-standard cryptography. We explicitly covenant and warrant that the session is utilized solely and strictly for automated interaction with @BotFather to discover your created Telegram bots and their API tokens. We NEVER read, access, record, harvest, or transmit your private chats, contacts, media, voice messages, or personal communications." ) LegalSection( title = "3. Intermediary Compliance and User Obligations", body = "Under Rule 3(1)(b) of the Indian Information Technology (Intermediary Guidelines) Rules, 2021, you agree that you will not host, display, upload, modify, publish, transmit, or share any information through your bot that: (a) belongs to another person and to which you do not have rights; (b) is defamatory, obscene, pornographic, pedophilic, or invasive of another person's privacy; (c) infringes any patent, trademark, copyright, or proprietary rights; (d) violates any law for the time being in force; or (e) threatens the unity, integrity, defense, security, or sovereignty of India." ) LegalSection( title = "4. Data Principal Rights and Account Erasure", body = "In compliance with the DPDP Act, 2023 and Google Play Store policies, you hold the right to summary, correction, and permanent erasure of your personal data. You may trigger complete account and bot data deletion at any time directly through the app settings or via our dedicated web URL." ) LegalSection( title = "5. Grievance Redressal Mechanism", body = "In accordance with Rule 3(2) of the Information Technology (Intermediary Guidelines) Rules, 2021, the designated Grievance Officer details are as follows:\n\n• Officer Name: Grievance Redressal Officer\n• Organization: TGBOT Builder Platform\n• Email Contact: grievance@tgbotbuilder.com / support@148.113.1.66\n• Physical Jurisdiction: India\n• Response Turnaround: Acknowledgment within 24 hours, resolution within 15 days of complaint receipt." ) } Spacer(Modifier.height(14.dp)) HorizontalDivider(color = MaterialTheme.colorScheme.outline.copy(alpha = 0.2f)) Spacer(Modifier.height(14.dp)) Row( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(10.dp) ) { TextButton( onClick = onDismiss, modifier = Modifier.weight(1f) ) { Text("Decline") } Button( onClick = { onAccept() onDismiss() }, modifier = Modifier.weight(1.5f), colors = ButtonDefaults.buttonColors(containerColor = PrimaryColor), shape = RoundedCornerShape(12.dp) ) { Text("I Agree and Accept", fontWeight = FontWeight.Bold, color = Color.White) } } } } } } @Composable private fun LegalSection( title: String, body: String ) { Column { Text( text = title, style = MaterialTheme.typography.titleSmall.copy(fontWeight = FontWeight.Bold), color = MaterialTheme.colorScheme.onSurface ) Spacer(Modifier.height(4.dp)) Text( text = body, style = MaterialTheme.typography.bodySmall.copy(lineHeight = 18.sp), color = MaterialTheme.colorScheme.onSurfaceVariant ) } }