import 'rollup-plugin-inject-process-env'; import { FC } from "react"; import { ActionBarButton as ActionBarButtonConfig, ActionBarConfig, ActionBarFormButton, ActionBarScheduleButton } from "@xapp/stentor-chat-widget"; import "./ActionBar.scss"; export interface ActionBarProps { readonly config: ActionBarConfig; /** * Whether the chat widget is currently visible/open */ readonly visible: boolean; /** * Whether the chat widget is disabled (chat buttons should be hidden) */ readonly chatDisabled?: boolean; /** * Whether a form widget already *is* this page, in which case the buttons that only * open one - `form` and `schedule` - are redundant and should be hidden. * * See `useIsFormPage`; the standalone contact/booking page is the case this exists for. */ readonly formDisabled?: boolean; /** * Whether the user has already interacted with the widget * (e.g., clicked chat button, sent a message, dismissed CTA) */ readonly hasUserInteracted?: boolean; /** * Called when the chat button is clicked to open chat */ readonly onChatClick: () => void; /** * Called when the chat button is clicked to close/minimize chat */ readonly onChatMinimize: () => void; /** * Called when form or schedule button is clicked */ readonly onFormClick: (button: ActionBarFormButton | ActionBarScheduleButton) => void; /** * Called when the CTA is dismissed */ readonly onCtaDismiss?: () => void; } /** * Whether pressing this button ends up in the form widget. * * `schedule` is the same form-widget infrastructure with a calendar icon, so it is the * same button as far as this question goes. XappMedia/chat-widget#1626. */ export declare function opensFormWidget(button: ActionBarButtonConfig): boolean; /** * Which of a bar's configured buttons would actually render. * * Exported because the decision is needed in two places: here, to render, and in * `ChatWidget`, to know whether the bar has anything left to show and whether anything on * the page can still open the form widget. Two copies of this predicate would drift. */ export declare function visibleActionBarButtons(buttons?: readonly ActionBarButtonConfig[], options?: Pick): readonly ActionBarButtonConfig[]; declare const ActionBar: FC; export default ActionBar;