Fix grafico nuova sessione
This commit is contained in:
+35
-28
@@ -8,31 +8,38 @@ export default function ChatHeader({
|
||||
onFreshStart,
|
||||
onCreateSession,
|
||||
onManageSession,
|
||||
sessionId, // <-- nuova prop
|
||||
sessionName // <-- nuova prop
|
||||
sessionId,
|
||||
sessionName
|
||||
}) {
|
||||
const hasSession = Boolean(sessionId);
|
||||
|
||||
return (
|
||||
<header
|
||||
className={`${theme.headerBg} p-2 sticky-top shadow row align-items-center`}
|
||||
>
|
||||
{/* Left column: control buttons + session name */}
|
||||
{/* Left column */}
|
||||
<div className="col-4 d-flex flex-wrap gap-2 align-items-center">
|
||||
<button
|
||||
className="btn btn-sm btn-outline-light"
|
||||
onClick={onReloadHistory}
|
||||
title="Reload current session history"
|
||||
>
|
||||
🔄
|
||||
</button>
|
||||
{hasSession && (
|
||||
<>
|
||||
<button
|
||||
className="btn btn-sm btn-outline-light"
|
||||
onClick={onReloadHistory}
|
||||
title="Reload current session history"
|
||||
>
|
||||
🔄
|
||||
</button>
|
||||
|
||||
<button
|
||||
className="btn btn-sm btn-warning"
|
||||
onClick={onFreshStart}
|
||||
title="Reset/Clear current session and start fresh"
|
||||
>
|
||||
🆕
|
||||
</button>
|
||||
<button
|
||||
className="btn btn-sm btn-warning"
|
||||
onClick={onFreshStart}
|
||||
title="Reset/Clear current session and start fresh"
|
||||
>
|
||||
🆕
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* Questi due pulsanti sempre visibili */}
|
||||
<button
|
||||
className="btn btn-sm btn-success"
|
||||
onClick={onCreateSession}
|
||||
@@ -49,8 +56,8 @@ export default function ChatHeader({
|
||||
📂
|
||||
</button>
|
||||
|
||||
{/* Box con nome sessione */}
|
||||
{sessionName && (
|
||||
{/* Nome sessione solo se esiste */}
|
||||
{hasSession && sessionName && (
|
||||
<span
|
||||
className="badge bg-secondary text-truncate small"
|
||||
style={{ maxWidth: "150px" }}
|
||||
@@ -61,20 +68,20 @@ export default function ChatHeader({
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Center column: title */}
|
||||
{/* Center column: titolo solo se c'è sessione */}
|
||||
<div className="col-5 text-center">
|
||||
<h4 className="mb-0">🤖 EgalWare's LLM ChatBot</h4>
|
||||
</div>
|
||||
|
||||
{/* Right column: theme toggle */}
|
||||
{/* Right column: toggle tema solo se c'è sessione */}
|
||||
<div className="col-3 d-flex flex-row-reverse">
|
||||
<button
|
||||
className="btn btn-sm btn-outline-light d-flex align-items-center gap-1"
|
||||
onClick={onToggleTheme}
|
||||
title="Toggle light/dark theme"
|
||||
>
|
||||
<span role="img" aria-label="theme toggle icon">🌓</span>
|
||||
</button>
|
||||
<button
|
||||
className="btn btn-sm btn-outline-light d-flex align-items-center gap-1"
|
||||
onClick={onToggleTheme}
|
||||
title="Toggle light/dark theme"
|
||||
>
|
||||
<span role="img" aria-label="theme toggle icon">🌓</span>
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
|
||||
@@ -7,11 +7,20 @@ export default function NoSessionBox({ onCreateSession }) {
|
||||
className="d-flex flex-column align-items-center justify-content-center text-center p-4"
|
||||
style={{ height: "100%", minHeight: "200px" }}
|
||||
>
|
||||
<h5 className="mb-3">Nessuna sessione attiva</h5>
|
||||
<p className="text-muted mb-4" style={{ maxWidth: "400px" }}>
|
||||
Per iniziare una nuova conversazione, crea una sessione.
|
||||
Potrai poi inviare messaggi e salvare la cronologia.
|
||||
</p>
|
||||
<h3 className="mb-3">Nessuna sessione attiva</h3>
|
||||
<div className="row">
|
||||
<div className="col-3"></div>
|
||||
<div className="col-6">
|
||||
<div className="text-muted mb-4">
|
||||
Per iniziare una nuova conversazione, crea una sessione assegnandole un nome.
|
||||
Potrai poi rivedere le sessioni precedendi e riprenderle salvando la cronologia.
|
||||
</div>
|
||||
<div className="alert alert-info shadow small text-muted">
|
||||
NB: il numero massimo di messaggi è limitato dalla finestra di contesto massima operativa e potrebbe portare a chiudere una sessione al raggiungimento del limite stesso.
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-3"></div>
|
||||
</div>
|
||||
<button
|
||||
className="btn btn-success"
|
||||
onClick={onCreateSession}
|
||||
|
||||
Reference in New Issue
Block a user