Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

1.2 KB
Raw Blame
import { OpenQuestionSummaryV2 } from 'scenes/surveys/components/question-visualizations/OpenQuestionSummaryV2'
import { VirtualizedResponseList } from 'scenes/surveys/components/question-visualizations/VirtualizedResponseList'

import { BasicSurveyQuestion, OpenQuestionResponseData } from '~/types'

interface Props {
    question: BasicSurveyQuestion
    questionIndex: number
    responseData: OpenQuestionResponseData[]
    totalResponses: number
}

export function OpenQuestionViz({ question, questionIndex, responseData, totalResponses }: Props): JSX.Element | null {
    return (
        <div className="space-y-4">
            <OpenQuestionSummaryV2
                questionId={question.id}
                questionIndex={questionIndex}
                totalResponses={totalResponses}
            />
            <div className="space-y-2">
                <h4 className="text-xs font-semibold uppercase tracking-wide text-muted">Responses</h4>
                <VirtualizedResponseList
                    responses={responseData}
                    className="rounded-md border bg-surface-secondary/60 p-2"
                />
            </div>
        </div>
    )
}