import { ActionType } from '../../_contract-src/action-payloads/action-type'; import { ShowSnackbarMessagePayload } from '../../_contract-src/action-payloads/show-snackbar-message/show-snackbar-message-payload'; import { postToHost } from './post-to-host'; /** * Displays a snackbar notification in the Struct PIM host application. * Use this to show success or error messages to the user from within an extension. * * @example * ```ts * struct.actions.showSnackbarMessage({ * message: 'Product synced successfully', * placement: 'bottom', * durationMs: 3000, * isError: false, * }); * ``` */ export function showSnackbarMessage(params: ShowSnackbarMessagePayload) { postToHost({ actionType: ActionType.ShowSnackbarMessage, payload: params }); }