DuplicateMangaDialog.kt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package eu.kanade.presentation.components
  2. import androidx.compose.foundation.layout.Row
  3. import androidx.compose.foundation.layout.Spacer
  4. import androidx.compose.material3.AlertDialog
  5. import androidx.compose.material3.Text
  6. import androidx.compose.material3.TextButton
  7. import androidx.compose.runtime.Composable
  8. import androidx.compose.ui.Modifier
  9. import androidx.compose.ui.res.stringResource
  10. import eu.kanade.tachiyomi.R
  11. @Composable
  12. fun DuplicateMangaDialog(
  13. onDismissRequest: () -> Unit,
  14. onConfirm: () -> Unit,
  15. onOpenManga: () -> Unit,
  16. ) {
  17. AlertDialog(
  18. onDismissRequest = onDismissRequest,
  19. confirmButton = {
  20. Row {
  21. TextButton(onClick = {
  22. onDismissRequest()
  23. onOpenManga()
  24. },) {
  25. Text(text = stringResource(R.string.action_show_manga))
  26. }
  27. Spacer(modifier = Modifier.weight(1f))
  28. TextButton(onClick = onDismissRequest) {
  29. Text(text = stringResource(R.string.action_cancel))
  30. }
  31. TextButton(
  32. onClick = {
  33. onDismissRequest()
  34. onConfirm()
  35. },
  36. ) {
  37. Text(text = stringResource(R.string.action_add))
  38. }
  39. }
  40. },
  41. title = {
  42. Text(text = stringResource(R.string.are_you_sure))
  43. },
  44. text = {
  45. Text(text = stringResource(R.string.confirm_add_duplicate_manga))
  46. },
  47. )
  48. }