blocks/faq-chat
Type Aliases
Section titled “Type Aliases”FaqChatEntry
Section titled “FaqChatEntry”FaqChatEntry =
object
One reviewed question and its fixed answer.
Properties
Section titled “Properties”id:
string
Stable identity for the entry.
question
Section titled “question”question:
string
The question as a visitor would ask it. Also shown as a suggestion.
answer
Section titled “answer”answer:
ReactNode
The reviewed answer. The chat never generates text of its own.
keywords?
Section titled “keywords?”
optionalkeywords?: readonlystring[]
Lowercase words or phrases that route a typed question here.
actions?
Section titled “actions?”
optionalactions?:ReactNode
Caller-owned next steps shown under the answer, such as links.
FaqChatFallback
Section titled “FaqChatFallback”FaqChatFallback =
object
The reply for a typed question that matches no entry.
Properties
Section titled “Properties”answer
Section titled “answer”answer:
ReactNode
actions?
Section titled “actions?”
optionalactions?:ReactNode
FaqChatProps
Section titled “FaqChatProps”FaqChatProps =
Omit<HTMLAttributes<HTMLElement>>,"title"> > &object
Props accepted by FaqChat.
Type Declaration
Section titled “Type Declaration”entries
Section titled “entries”entries: readonly
FaqChatEntry[]
greeting
Section titled “greeting”greeting:
ReactNode
The first agent message, shown before any question.
fallback
Section titled “fallback”fallback:
FaqChatFallback
title:
ReactNode
Visible heading and accessible name of the chat.
optionalnote?:ReactNode
A short honest note about where answers come from.
avatar?
Section titled “avatar?”
optionalavatar?:ReactNode
Optional mark shown beside the title, such as a logo.
inputLabel?
Section titled “inputLabel?”
optionalinputLabel?:string
Accessible label of the typed-question field.
placeholder?
Section titled “placeholder?”
optionalplaceholder?:string
submitLabel?
Section titled “submitLabel?”
optionalsubmitLabel?:string
Variables
Section titled “Variables”FaqChat
Section titled “FaqChat”
constFaqChat:ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>>,"title"> > &object&RefAttributes<HTMLElement>>>>
A chat-shaped FAQ. Visitors pick or type a question and get the caller’s reviewed answer with its next steps. Message rows follow Parakeet: the visitor’s turn sits on the surface with a primary rule, the answer is plain.
Functions
Section titled “Functions”matchFaqEntry()
Section titled “matchFaqEntry()”matchFaqEntry(
entries,text):FaqChatEntry|undefined
Routes a typed question to the entry whose keywords it mentions most. Returns undefined when nothing matches, so the caller can answer honestly.
Parameters
Section titled “Parameters”entries
Section titled “entries”readonly FaqChatEntry[]
string
Returns
Section titled “Returns”FaqChatEntry | undefined