Deploy 2026-06-01T22:10:12.283Z
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { useState, useRef, useEffect } from 'react'
|
||||
import { marked } from 'marked'
|
||||
import './App.css'
|
||||
|
||||
marked.setOptions({ breaks: true, gfm: true })
|
||||
|
||||
const API_URL = window.location.hostname === 'localhost'
|
||||
? 'http://localhost:4003'
|
||||
: 'https://diet-api.psbailey.uk'
|
||||
@@ -77,7 +80,10 @@ export default function App() {
|
||||
)}
|
||||
{messages.map((msg, i) => (
|
||||
<div key={i} className={`msg ${msg.role}`}>
|
||||
<div className="bubble">{msg.content || '...'}</div>
|
||||
{msg.role === 'assistant'
|
||||
? <div className="bubble" dangerouslySetInnerHTML={{ __html: marked.parse(msg.content || '...') }} />
|
||||
: <div className="bubble">{msg.content}</div>
|
||||
}
|
||||
</div>
|
||||
))}
|
||||
<div ref={messagesEnd} />
|
||||
|
||||
Reference in New Issue
Block a user