import { actionExecutor, ActionResult, } from "@applicaster/zapp-react-native-utils/actionsExecutor/ActionExecutor"; import { TextInputContent } from "./TextInputContent"; /** * Opens a text-input bottom sheet driven by action.options. * Uses openBottomSheet with content.component as body-only UI; * standard ModalHeader (dismiss x) is provided by ModalComponent. */ export async function showTextInputAction( action: ActionType, context?: Record ): Promise { const { headerTitle, inputLabel, defaultValue, buttonLabel, actions } = action.options || {}; if (!headerTitle || !buttonLabel || !actions || !actions.length) { return ActionResult.Error; } return actionExecutor.handleAction( { type: "openBottomSheet", options: { header: { title: headerTitle, }, content: { component: TextInputContent, props: { inputLabel, defaultValue: defaultValue ?? "", buttonLabel, actions, }, }, }, }, context ); }