Deploy 2026-06-01T22:10:12.283Z

This commit is contained in:
2026-06-01 23:10:12 +01:00
parent 8c6e1e9af7
commit 3edfe36e0a
4 changed files with 78 additions and 2 deletions

View File

@@ -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} />