feat(frontend): Scholarchat-inspired UI refactor with top nav, sidebar, and message actions
- Add TopNav component with AI Chat, Study Guides, Progress tabs - Refactor sidebar to include brand, new chat, subjects, chat history, settings - Add message action buttons (Helpful, Note, Deeper) on assistant responses - Enhance ChatInput with photo, mic attachment icons and AI disclaimer - Improve welcome state with 2x2 suggested prompt grid - Update global layout for proper sidebar offset (fix nav overlap) - Remove obsolete Header component - All styles: strict BEM naming, zero inline CSS, Paper Look theme
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
/* ========================================
|
||||
Message Component — padhLe
|
||||
======================================== */
|
||||
|
||||
import "./Message.css";
|
||||
|
||||
const Message = ({ message }) => {
|
||||
const { role, text } = message;
|
||||
const isUser = role === "user";
|
||||
|
||||
return (
|
||||
<div className={`message ${isUser ? "message--user" : "message--assistant"}`}>
|
||||
<div className="message__bubble">
|
||||
<div className="message__text">{text}</div>
|
||||
</div>
|
||||
|
||||
{/* Action buttons only for assistant messages */}
|
||||
{!isUser && (
|
||||
<div className="message__actions">
|
||||
<button className="message__action" aria-label="Helpful" title="Helpful">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||
<path d="M7 22h4c1.1 0 2-.9 2-2v-4c0-.57-.24-1.09-.62-1.47L13 11.76c.38-.38.62-.9.62-1.47V7c0-1.1-.9-2-2-2H7c-1.1 0-2 .9-2 2v12c0 3.31 2.69 6 6 6h8v-2h-2.11c-.18-.5-.29-1.04-.29-1.6V22z" />
|
||||
</svg>
|
||||
<span>Helpful</span>
|
||||
</button>
|
||||
<button className="message__action" aria-label="Save note" title="Save Note">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||
<path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z" />
|
||||
</svg>
|
||||
<span>Note</span>
|
||||
</button>
|
||||
<button className="message__action" aria-label="Explain deeper" title="Explain Deeper">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||
<path d="M12 2a10 10 0 1 0 10 10H12V2z" />
|
||||
<path d="M12 2a10 10 0 0 1 10 10" />
|
||||
</svg>
|
||||
<span>Deeper</span>
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Message;
|
||||
Reference in New Issue
Block a user