import type { ReactNode } from 'react' /** 单个问题的选项 */ export interface UserQuestionOption { label: string description?: string } /** 单个问题 */ export interface UserQuestionItem { question: string header?: string options: UserQuestionOption[] multiSelect?: boolean /** 是否允许用户自定义输入(默认 true) */ allowCustomInput?: boolean } export interface UserQuestionLabels { multiSelect?: string singleSelect?: string questionHeader?: string skipAll?: string continue?: string submit?: string sending?: string customInputPlaceholder?: string recommend?: string } export const DEFAULT_LABELS: Required = { multiSelect: 'Multi-select', singleSelect: 'Single-select', questionHeader: 'Question', skipAll: 'Skip All', continue: 'Continue', submit: 'Submit', sending: 'Sending...', customInputPlaceholder: 'Other (please specify)', recommend: 'Recommend', } /** 跳过问题时填充的默认值 */ export const NO_PREFERENCE_VALUE = '[No preference]' export interface UserQuestionProps { questions: UserQuestionItem[] resetKey?: string onAnswer: (answers: Record) => void onSkip: () => void hasCustomText?: boolean labels?: UserQuestionLabels chat4Icon?: ReactNode arrowUpSIcon?: ReactNode arrowDownSIcon?: ReactNode sparklingIcon?: ReactNode } export interface UserQuestionHandle { getAnswers: () => Record }