@veracity/vui
Version:
Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.
44 lines (42 loc) • 1.21 kB
JavaScript
import { cs } from "../utils/styles.js";
import { useStyleConfig } from "../core/theme.js";
import vui from "../core/vui.js";
import { Box } from "../box/box.js";
import { Avatar } from "../avatar/avatar.js";
import { MessageBase } from "../message/message.js";
import { jsx, jsxs } from "react/jsx-runtime";
//#region src/chat/chatMessage.tsx
const defaultAvatar = {
variant: "solidDarkBlue",
icon: "brandVeracity"
};
/**
* Displays a chat interface with messages and actions.
*/
const ChatMessage = vui((props, ref) => {
const styles = useStyleConfig("Chat", props);
const { avatar = defaultAvatar, children, text, intent: _intent, size: _size, ...rest } = props;
return /* @__PURE__ */ jsxs(MessageBase, {
className: cs("vui-chat-message"),
display: "flex",
h: "100%",
my: "16px",
ref,
...styles?.message,
...rest,
children: [/* @__PURE__ */ jsx(Avatar, {
mr: "16px",
...avatar
}), /* @__PURE__ */ jsx(Box, {
color: "black",
mt: "4px",
w: "100%",
children: children ?? text
})]
});
});
ChatMessage.displayName = "ChatMessage";
//#endregion
export { ChatMessage, ChatMessage as default };
globalThis.__vuiVersion__ = "5.3.1"
//# sourceMappingURL=chatMessage.js.map