stream-chat-react
Version:
React components to create chat conversations or livestream style chat
14 lines (13 loc) • 1.19 kB
JavaScript
import React from 'react';
var UnMemoizedAttachmentActions = function (props) {
var actionHandler = props.actionHandler, actions = props.actions, id = props.id, text = props.text;
var handleActionClick = function (event, name, value) { return actionHandler === null || actionHandler === void 0 ? void 0 : actionHandler(name, value, event); };
return (React.createElement("div", { className: 'str-chat__message-attachment-actions' },
React.createElement("div", { className: 'str-chat__message-attachment-actions-form' },
React.createElement("span", null, text),
actions.map(function (action) { return (React.createElement("button", { className: "str-chat__message-attachment-actions-button str-chat__message-attachment-actions-button--".concat(action.style), "data-testid": "".concat(action.name), "data-value": action.value, key: "".concat(id, "-").concat(action.value), onClick: function (event) { return handleActionClick(event, action.name, action.value); } }, action.text)); }))));
};
/**
* A component for rendering the actions you can take on an attachment.
*/
export var AttachmentActions = React.memo(UnMemoizedAttachmentActions);