QAPanel is the audience Q&A surface — question feed sorted by upvotes, with a composer at the bottom for asking and host-only "mark answered live" / "type answer" actions. Composes useQA.
Install
pnpm add @levelchat/react-components @levelchat/webBasic usage
import { QAPanel } from '@levelchat/react-components';
<QAPanel isHost={isHost} className="h-full w-80" />Sorting + status
The server returns questions sorted by (status='open' ? 0 : 1, upvotes desc, createdAt asc). The burning, well-upvoted question lands at the top; answered ones drop to the bottom but stay visible.
Three status states:
- open — awaiting an answer.
- answered-live — host marked answered live (they spoke it).
- answered-text — host typed a written response, attached.
Host actions
- "Mark answered live" — flips the status to
answered-live. - "Type answer" — opens an inline textarea; submitting attaches the text + flips to
answered-text.
Accessibility
role="region"+aria-label="Q and A"on the panel.- Upvote buttons are
aria-pressedfor toggle semantics. - Question list is
<ul role="feed">.
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
isHost | boolean | false | Show host-only mark-answered / type-answer actions. |
hideComposer | boolean | false | Hide the ask composer. |
placeholder | string | "Ask a question…" | Composer placeholder. |