Skip to content

Latest commit

 

History

History

message-feed

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Message Feed

Installation

Yarn

yarn add @lg-chat/message-feed

NPM

npm install @lg-chat/message-feed

Example

import { MessageFeed } from '@lg-chat/message-feed';

return (
  <MessageFeed darkMode={darkMode} {...rest}>
    {messages.map(
      ({ id, isMongo, messageBody, userName, messageRatingProps }) => (
        <Message
          key={id}
          sourceType="markdown"
          darkMode={darkMode}
          avatar={
            <Avatar
              variant={isMongo ? 'mongo' : 'user'}
              darkMode={darkMode}
              name={userName}
            />
          }
          isSender={!!userName}
          messageRatingProps={messageRatingProps}
        >
          {messageBody}
        </Message>
      ),
    )}
  </MessageFeed>
);

Properties

Prop Type Description Default
darkMode boolean Determines if the component should render in dark mode false
... HTMLElementProps<'div'> Props spread on root element