import React, { useState } from 'react'; import { Card } from '../components/UiKit'; import { QuestionInput } from '../components/ui/QuestionInput'; import { Question } from '../components/ui/Question'; import { FigmaQuestion } from '../components/figma/FigmaQuestion'; import { EmployeeQuestion } from '../employeeQuestions'; const QuestionTypesDemo: React.FC = () => { const [answers, setAnswers] = useState>({}); const demoQuestions: EmployeeQuestion[] = [ { id: 'text_demo', prompt: 'What is your full name?', category: 'personal', type: 'text', placeholder: 'Enter your full name', required: true, }, { id: 'scale_demo', prompt: 'How satisfied are you with your role?', category: 'role', type: 'scale', scaleMin: 1, scaleMax: 10, scaleLabels: { min: 'Very dissatisfied', max: 'Very satisfied' }, required: true, }, { id: 'yesno_demo', prompt: 'Do you have regular one-on-ones with your manager?', category: 'collaboration', type: 'yesno', required: false, }, { id: 'textarea_demo', prompt: 'Describe your main responsibilities', category: 'role', type: 'textarea', placeholder: 'List your key daily tasks and responsibilities...', required: true, }, { id: 'select_demo', prompt: 'What is your department?', category: 'role', type: 'select', options: ['Engineering', 'Marketing', 'Sales', 'HR', 'Finance', 'Operations'], required: false, } ]; const [currentDemoQuestion, setCurrentDemoQuestion] = useState(0); const handleAnswerChange = (questionId: string, value: string) => { setAnswers(prev => ({ ...prev, [questionId]: value })); }; return (

Question Types Demo

Showcase of different question input types for the employee questionnaire

{/* Traditional Question Layout */}

Traditional Layout

{demoQuestions.map((question, index) => ( handleAnswerChange(question.id, value)} /> ))}
{/* Figma Question Layout */}

Figma Design Layout

{demoQuestions.map((_, index) => ( ))}
handleAnswerChange(demoQuestions[currentDemoQuestion].id, value) } onBack={ currentDemoQuestion > 0 ? () => setCurrentDemoQuestion(prev => prev - 1) : undefined } onNext={ currentDemoQuestion < demoQuestions.length - 1 ? () => setCurrentDemoQuestion(prev => prev + 1) : undefined } nextLabel={ currentDemoQuestion < demoQuestions.length - 1 ? 'Next' : 'Finish' } />
{/* Alternative Input Below Figma Question */}
handleAnswerChange(demoQuestions[currentDemoQuestion].id, value) } />
{/* Current Answers Display */}

Current Answers

{demoQuestions.map((question) => (
{question.prompt}
{question.type}
{answers[question.id] || No answer}
))}
{/* Navigation Links */}
Traditional Questionnaire Stepped Questionnaire
); }; export default QuestionTypesDemo;