'use client'; import React from 'react'; import { Card } from '../Card'; import { Button } from '../Button'; import { Badge } from '../Badge'; import { Progress } from '../Progress'; import { Icon } from '../Icon'; export interface QuestionChoice { id: string; label: string; shortcut?: string; } export interface QuestionnaireProps extends Omit, 'onSelect'> { category?: string; points?: number; prompt: string; description?: string; choices: QuestionChoice[]; selectedId?: string; currentStep: number; totalSteps: number; onSelect?: (choiceId: string) => void; onNext?: () => void; onPrev?: () => void; onSkip?: () => void; feedback?: string; feedbackType?: 'correct' | 'incorrect' | 'neutral'; } export function Questionnaire({ category, points, prompt, description, choices, selectedId, currentStep, totalSteps, onSelect, onNext, onPrev, onSkip, feedback, feedbackType = 'neutral', className = '', ...props }: QuestionnaireProps) { const progressPercent = Math.round((currentStep / totalSteps) * 100); return (
{/* Progress */}
{currentStep} / {totalSteps}
{/* Question Card */} {/* Meta */}
{category && {category}} {points !== undefined && ( {points} نقاط )}
{/* Prompt */}

{prompt}

{description && (

{description}

)} {/* Choices */}
{choices.map((choice) => { const isSelected = selectedId === choice.id; return ( ); })}
{/* Feedback */} {feedback && (
{feedback}
)}
{/* Actions */}
{onSkip && ( )}
); }