MCPcopy Create free account
hub / github.com/EyuCoder/chatgpt-pro / Message

Function Message

src/components/Message.jsx:12–48  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

10 * @param {Object} props - The properties for the component.
11 */
12const Message = (props) => {
13 const { id, createdAt, text, ai = false, selected } = props.message;
14
15 return (
16 <div
17 key={id}
18 className={`flex items-end my-2 gap-2 ${
19 ai ? 'flex-row-reverse justify-end' : 'flex-row justify-end'
20 }`}>
21 {selected === 'DALL·E' && ai ? (
22 <Image url={text} />
23 ) : (
24 <div
25 className={` w-screen overflow-hidden chat ${
26 ai ? 'chat-start' : 'chat-end'
27 }`}>
28 <div className='chat-bubble text-neutral-content'>
29 <Markdown markdownText={text} />
30 <div className={`${ai ? 'text-left' : 'text-right'} text-xs`}>
31 {moment(createdAt).calendar()}
32 </div>
33 </div>
34 </div>
35 )}
36
37 <div className='avatar'>
38 <div className='w-8 border rounded-full border-slate-400'>
39 {ai ? (
40 <MdComputer className='w-6 h-full m-auto' />
41 ) : (
42 <MdPerson className='w-6 h-full m-auto' />
43 )}
44 </div>
45 </div>
46 </div>
47 );
48};
49
50export default Message;
51

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected