KPGenericDialog

fun KPGenericDialog(type: GenericDialogType, displayCloseButton: Boolean, modifier: Modifier = Modifier, dialogProperties: DialogProperties = DialogProperties(), title: String = "", message: String = "", icon: @Composable () -> Unit? = null, primaryButton: @Composable DialogButtons.() -> Unit? = null, secondaryButton: @Composable DialogButtons.() -> Unit? = null, onCloseClick: () -> Unit = {}, onDismissRequest: () -> Unit)

This composable function allows you to create a generic dialog with various configurable options including the type of dialog, optional title, message, icon, and action buttons. The dialog can be customized to display or hide a close button and will invoke the provided callbacks when actions are performed.

Parameters

type

Specifies the type of the dialog. Success, Error, Custom.

modifier

Modifier to be applied to the dialog container.

dialogProperties

Configuration options for the dialog's behavior.

displayCloseButton

Boolean to indicate whether a close button should be displayed in the dialog.

title

Optional title text to be displayed at the top of the dialog. Defaults to an empty string.

message

Optional message content to be displayed in the dialog. Defaults to an empty string.

icon

Optional composable function to display an icon within the dialog. If null, no icon is shown.

primaryButton

Composable function for the primary action button. If null, no primary button is shown.

secondaryButton

Composable function for the secondary action button. If null, no secondary button is shown.

onCloseClick

Lambda function to be invoked when the close button is clicked. Defaults to an empty function.

onDismissRequest

Lambda function to be called when the dialog is requested to be dismissed.