import React from 'react'; import { StyleProp, ViewStyle } from 'react-native'; import { Socket } from 'socket.io-client'; import { ConfirmExitOptions } from '../../methods/exitMethods/confirmExit'; /** * Options for configuring `ConfirmExitModal`. * * @interface ConfirmExitModalOptions * * **Modal Control:** * @property {boolean} isConfirmExitModalVisible Toggles the visibility of the modal. * @property {() => void} onConfirmExitClose Called when the modal should close. * * **Appearance:** * @property {'topRight' | 'topLeft' | 'bottomRight' | 'bottomLeft'} [position='topRight'] Anchor position on screen. * @property {string} [backgroundColor='#83c0e9'] Card background color. * @property {StyleProp} [style] Additional styling for the modal container. * * **Exit Behaviour:** * @property {(options: ConfirmExitOptions) => void} [exitEventOnConfirm=confirmExit] Handler triggered on confirm. * @property {string} member Name of the participant exiting. * @property {boolean} [ban=false] Whether the participant should be banned on exit. * @property {string} roomName Active room identifier. * @property {Socket} socket Socket instance used for exit events. * @property {string} islevel User level determining available actions (e.g., `'2'` for admin). * * **Advanced Render Overrides:** * @property {(options: { defaultContent: JSX.Element; dimensions: { width: number; height: number } }) => JSX.Element} [renderContent] * Custom renderer for modal body. * @property {(options: { defaultContainer: JSX.Element; dimensions: { width: number; height: number } }) => JSX.Element} [renderContainer] * Custom renderer for modal shell. */ export interface ConfirmExitModalOptions { isConfirmExitModalVisible: boolean; onConfirmExitClose: () => void; position?: 'topRight' | 'topLeft' | 'bottomRight' | 'bottomLeft'; backgroundColor?: string; exitEventOnConfirm?: (options: ConfirmExitOptions) => void; member: string; ban?: boolean; roomName: string; socket: Socket; islevel: string; style?: StyleProp; renderContent?: (options: { defaultContent: JSX.Element; dimensions: { width: number; height: number; }; }) => JSX.Element; renderContainer?: (options: { defaultContainer: JSX.Element; dimensions: { width: number; height: number; }; }) => JSX.Element; } export type ConfirmExitModalType = (options: ConfirmExitModalOptions) => JSX.Element; /** * ConfirmExitModal confirms whether a participant should leave or, for admins, end the event for all. * It coordinates socket-based exits, respects ban flags, and surfaces override hooks for custom UI. * * ### Key Features * - Differentiates between regular exit and admin-level "End Event" actions. * - Calls `exitEventOnConfirm` with socket context for flexible business logic. * - Supports corner anchoring, theming, and render overrides. * - Provides clear call-to-action buttons with accessible labels. * * ### Accessibility * - Buttons expose descriptive `accessibilityLabel` values. * - Focusable layout ensures keyboard navigation across controls. * * @param {ConfirmExitModalOptions} props Modal configuration. * @returns {JSX.Element} Rendered confirmation modal. * * @example Standard exit confirmation. * ```tsx * * ``` * * @example Admin ending the event with custom styling. * ```tsx * ( * {defaultContent} * )} * /> * ``` */ declare const ConfirmExitModal: React.FC; export default ConfirmExitModal;