This commit is contained in:
legop3
2025-11-24 03:23:22 -05:00
parent f80d2445b0
commit 7bbb039da1
8 changed files with 32 additions and 24 deletions
+7 -3
View File
@@ -25,7 +25,7 @@ function displayName(message) {
return message.nickname || message.socketId?.slice(0, 6) || 'unknown';
}
export default function ChatPanel({ hideInput = false, hideSpectatorNotice = false }) {
export default function ChatPanel({ hideInput = false, hideSpectatorNotice = false, fillParent = false }) {
const { session } = useSession();
const { messages, sendMessage, registerInputRef, onInputFocus, onInputBlur, blurChat } = useChat();
const [draft, setDraft] = useState('');
@@ -57,9 +57,13 @@ export default function ChatPanel({ hideInput = false, hideSpectatorNotice = fal
}
}
const listClass = fillParent
? 'flex-1 min-h-[8rem]'
: 'h-48';
return (
<section className="panel-section flex h-full flex-col space-y-0.5 text-base overflow-hidden">
<div className="surface flex-1 min-h-[8rem] overflow-y-auto space-y-0.25" ref={listRef}>
<section className={`panel-section ${fillParent ? 'flex h-full flex-col overflow-hidden' : ''} space-y-0.5 text-base`}>
<div className={`surface overflow-y-auto space-y-0.25 ${listClass}`} ref={listRef}>
{sorted.length === 0 ? (
<p className="text-sm text-slate-500">No messages yet.</p>
) : (