import React, { useState } from 'react';
import { useParams } from 'react-router-dom';
import { FigmaRatingScale, FigmaTextArea, FigmaNavigationButtons } from '../components/figma/FigmaQuestion';
import { FigmaMultipleChoice } from '../components/figma/FigmaMultipleChoice';
// Icon SVG Component
const AuditlyIcon: React.FC = () => (
);
// Progress Bar Component for Section Headers
const SectionProgressBar: React.FC<{ currentSection: number; totalSections: number }> = ({ currentSection, totalSections }) => {
return (
{Array.from({ length: 7 }, (_, index) => {
const isActive = index === 0; // First step is always active for section start
return (
{index === 0 ? (
) : (
)}
);
})}
);
};
// Yes/No Choice Component
const YesNoChoice: React.FC<{
question: string;
value?: string;
onChange: (value: string) => void;
onBack?: () => void;
onNext: () => void;
onSkip?: () => void;
currentStep?: number;
totalSteps?: number;
}> = ({ question, value, onChange, onBack, onNext, onSkip, currentStep, totalSteps }) => {
return (
{question}
onChange('No')}
className={`w-20 h-20 relative rounded-[999px] overflow-hidden cursor-pointer transition-colors ${value === 'No' ? 'bg-Neutrals-NeutralSlate800' : 'bg-Neutrals-NeutralSlate100 hover:bg-Neutrals-NeutralSlate200'}`}
>
No
onChange('Yes')}
className={`w-20 h-20 relative rounded-[999px] overflow-hidden cursor-pointer transition-colors ${value === 'Yes' ? 'bg-Neutrals-NeutralSlate800' : 'bg-Neutrals-NeutralSlate100 hover:bg-Neutrals-NeutralSlate200'}`}
>
Yes
{/* Skip button */}
{onSkip && (
)}
{/* Progress indicators */}
{currentStep && totalSteps && (
<>
{currentStep} of {totalSteps}
Leadership & Organizational Structure
>
)}
);
};
// Section Intro Component
const SectionIntro: React.FC<{
sectionNumber: string;
title: string;
description: string;
onStart: () => void;
imageUrl?: string;
}> = ({ sectionNumber, title, description, onStart, imageUrl = "https://placehold.co/560x682" }) => {
return (
);
};
// Step 1: Welcome & Role Information (Light)
const EmployeeFormStep1: React.FC<{ onNext: (data: any) => void }> = ({ onNext }) => {
const [formData, setFormData] = useState({
name: '',
role: '',
department: ''
});
const handleSubmit = () => {
onNext(formData);
};
return (
Welcome to the Auditly Employee Assessment
Let's learn about your role, contribution and help us get a better understand of how you work best.
Tell us about your current role and what you work on
What is your role at the company?
*
What department do you work in?
*
);
};
// Step 2: Personal Information
const EmployeeFormStep2: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [formData, setFormData] = useState({
email: '',
name: '',
company: ''
});
return (
Personal Information
What is the name of your Company and department?
*
);
};
// Step 3: Current Title and Department (Text Area)
const EmployeeFormStep3: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ titleAndDepartment: answer })}
onSkip={() => onNext({ titleAndDepartment: '' })}
nextDisabled={!answer.trim()}
currentStep={1}
totalSteps={7}
/>
);
};
// Step 4: Daily Tasks (Text Area)
const EmployeeFormStep4: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ dailyTasks: answer })}
onSkip={() => onNext({ dailyTasks: '' })}
nextDisabled={!answer.trim()}
currentStep={2}
totalSteps={7}
/>
);
};
// Step 5: Role Understanding Rating
const EmployeeFormStep5: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [rating, setRating] = useState();
return (
onNext({ roleUnderstanding: rating })}
onSkip={() => onNext({ roleUnderstanding: null })}
nextDisabled={!rating}
currentStep={3}
totalSteps={7}
/>
);
};
// Step 6: Work Satisfaction
const EmployeeFormStep6: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [rating, setRating] = useState();
return (
onNext({ workSatisfaction: rating })}
onSkip={() => onNext({ workSatisfaction: null })}
nextDisabled={!rating}
currentStep={4}
totalSteps={7}
/>
);
};
// Step 7: Communication Rating
const EmployeeFormStep7: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [rating, setRating] = useState();
return (
onNext({ communicationRating: rating })}
onSkip={() => onNext({ communicationRating: null })}
nextDisabled={!rating}
currentStep={5}
totalSteps={7}
/>
);
};
// Step 8: Work Style Preference
const EmployeeFormStep8: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [selectedOption, setSelectedOption] = useState('');
const options = [
'I prefer working independently',
'I enjoy collaborative teamwork',
'I like a mix of both',
'I prefer clear instructions and structure',
'I thrive with autonomy and flexibility'
];
return (
onNext({ workStyle: selectedOption })}
onSkip={() => onNext({ workStyle: '' })}
nextDisabled={!selectedOption}
currentStep={6}
totalSteps={7}
/>
);
};
// Step 9: Section Intro - Output & Accountability
const EmployeeFormStep9: React.FC<{ onNext: () => void }> = ({ onNext }) => {
return (
);
};
// Step 10: Weekly Output Rating
const EmployeeFormStep10: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [rating, setRating] = useState();
return (
onNext({ weeklyOutput: rating })}
onSkip={() => onNext({ weeklyOutput: null })}
nextDisabled={!rating}
currentStep={1}
totalSteps={7}
/>
);
};
// Step 11: Top Deliverables
const EmployeeFormStep11: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ topDeliverables: answer })}
onSkip={() => onNext({ topDeliverables: '' })}
nextDisabled={!answer.trim()}
currentStep={2}
totalSteps={7}
/>
);
};
// Step 12: Measurable Results
const EmployeeFormStep12: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ measurableResults: answer })}
onSkip={() => onNext({ measurableResults: '' })}
nextDisabled={!answer.trim()}
currentStep={3}
totalSteps={7}
/>
);
};
// Step 13: Weekly KPIs
const EmployeeFormStep13: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ hasKPIs: answer })}
onSkip={() => onNext({ hasKPIs: '' })}
currentStep={4}
totalSteps={7}
/>
);
};
// Step 14: KPI Details
const EmployeeFormStep14: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ kpiDetails: answer })}
onSkip={() => onNext({ kpiDetails: '' })}
currentStep={5}
totalSteps={7}
/>
);
};
// Step 15: Reporting Structure
const EmployeeFormStep15: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ reportingStructure: answer })}
onSkip={() => onNext({ reportingStructure: '' })}
currentStep={6}
totalSteps={7}
/>
);
};
// Step 16: Section Intro - Team & Collaboration
const EmployeeFormStep16: React.FC<{ onNext: () => void }> = ({ onNext }) => {
return (
);
};
// Step 17: Work Closest With
const EmployeeFormStep17: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ workClosestWith: answer })}
onSkip={() => onNext({ workClosestWith: '' })}
currentStep={1}
totalSteps={7}
/>
);
};
// Step 18: Collaboration Issues
const EmployeeFormStep18: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ collaborationIssues: answer })}
onSkip={() => onNext({ collaborationIssues: '' })}
currentStep={2}
totalSteps={7}
/>
);
};
// Step 19: Team Communication Rating
const EmployeeFormStep19: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [rating, setRating] = useState();
return (
onNext({ teamCommunication: rating })}
onSkip={() => onNext({ teamCommunication: null })}
nextDisabled={!rating}
currentStep={3}
totalSteps={7}
/>
);
};
// Step 20: Team Support
const EmployeeFormStep20: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ teamSupport: answer })}
onSkip={() => onNext({ teamSupport: '' })}
currentStep={4}
totalSteps={7}
/>
);
};
// Step 21: Tools and Resources Section
const EmployeeFormStep21: React.FC<{ onNext: () => void }> = ({ onNext }) => {
return (
);
};
// Step 22: Current Tools
const EmployeeFormStep22: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ currentTools: answer })}
onSkip={() => onNext({ currentTools: '' })}
currentStep={1}
totalSteps={7}
/>
);
};
// Step 23: Tool Effectiveness
const EmployeeFormStep23: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [rating, setRating] = useState();
return (
onNext({ toolEffectiveness: rating })}
onSkip={() => onNext({ toolEffectiveness: null })}
nextDisabled={!rating}
currentStep={2}
totalSteps={7}
/>
);
};
// Step 24: Missing Tools
const EmployeeFormStep24: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ missingTools: answer })}
onSkip={() => onNext({ missingTools: '' })}
currentStep={3}
totalSteps={7}
/>
);
};
// Step 25: Skills & Development Section
const EmployeeFormStep25: React.FC<{ onNext: () => void }> = ({ onNext }) => {
return (
);
};
// Step 26: Key Skills
const EmployeeFormStep26: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ keySkills: answer })}
onSkip={() => onNext({ keySkills: '' })}
currentStep={1}
totalSteps={7}
/>
);
};
// Step 27: Skill Development
const EmployeeFormStep27: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ skillDevelopment: answer })}
onSkip={() => onNext({ skillDevelopment: '' })}
currentStep={2}
totalSteps={7}
/>
);
};
// Step 28: Training Opportunities
const EmployeeFormStep28: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ awareOfTraining: answer })}
onSkip={() => onNext({ awareOfTraining: '' })}
currentStep={3}
totalSteps={7}
/>
);
};
// Step 29: Career Goals
const EmployeeFormStep29: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ careerGoals: answer })}
onSkip={() => onNext({ careerGoals: '' })}
currentStep={4}
totalSteps={7}
/>
);
};
// Step 30: Feedback & Improvement Section
const EmployeeFormStep30: React.FC<{ onNext: () => void }> = ({ onNext }) => {
return (
);
};
// Step 31: Company Improvements
const EmployeeFormStep31: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ companyImprovements: answer })}
onSkip={() => onNext({ companyImprovements: '' })}
currentStep={1}
totalSteps={7}
/>
);
};
// Step 32: Job Satisfaction
const EmployeeFormStep32: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [rating, setRating] = useState();
return (
onNext({ jobSatisfaction: rating })}
onSkip={() => onNext({ jobSatisfaction: null })}
nextDisabled={!rating}
currentStep={2}
totalSteps={7}
/>
);
};
// Step 33: Additional Feedback
const EmployeeFormStep33: React.FC<{ onNext: (data: any) => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = useState('');
return (
onNext({ additionalFeedback: answer })}
onSkip={() => onNext({ additionalFeedback: '' })}
currentStep={3}
totalSteps={7}
/>
);
};
// Step 35: Leadership & Organizational Structure - Magic Wand Question
const EmployeeFormStep35: React.FC<{ onNext: () => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = React.useState('');
return (
If you had a magic wand, what would you change about how we operate?
Leadership & Organizational Structure
);
};
// Step 36: Overstaffed/Underperforming Departments
const EmployeeFormStep36: React.FC<{ onNext: () => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = React.useState('');
return (
Do you believe any roles or departments are overstaffed or underperforming?
Leadership & Organizational Structure
);
};
// Step 37: Any Other Feedback
const EmployeeFormStep37: React.FC<{ onNext: () => void; onBack: () => void }> = ({ onNext, onBack }) => {
const [answer, setAnswer] = React.useState('');
return (
Any other feedback or suggestions?
Leadership & Organizational Structure
);
};
// Step 38: Thank You Page (Final)
const EmployeeFormStep38: React.FC<{ formData: any }> = ({ formData }) => {
return (
Thank you your form has been submitted!
Description about the topic and what it means.
);
};
// Step 34: Section Outro - Leadership & Organizational Structure
const EmployeeFormStep34: React.FC<{ onNext: () => void; onBack: () => void }> = ({ onNext, onBack }) => {
return (
);
};
// Main Controller Component
const EmployeeFormsController: React.FC = () => {
const { inviteCode } = useParams();
const [currentStep, setCurrentStep] = useState(1);
const [formData, setFormData] = useState({});
const handleNext = (stepData?: any) => {
if (stepData) {
const newFormData = { ...formData, ...stepData };
setFormData(newFormData);
}
if (currentStep === 37) {
// Submit form data here
console.log('Submitting form data:', formData);
// TODO: Submit to backend
}
setCurrentStep(currentStep + 1);
};
const handleBack = () => {
setCurrentStep(currentStep - 1);
};
const handleSkip = () => {
setCurrentStep(currentStep + 1);
};
const renderStep = () => {
switch (currentStep) {
case 1:
return ;
case 2:
return ;
case 3:
return ;
case 4:
return ;
case 5:
return ;
case 6:
return ;
case 7:
return ;
case 8:
return ;
case 9:
return handleNext()} />;
case 10:
return ;
case 11:
return ;
case 12:
return ;
case 13:
return ;
case 14:
return ;
case 15:
return ;
case 16:
return handleNext()} />;
case 17:
return ;
case 18:
return ;
case 19:
return ;
case 20:
return ;
case 21:
return handleNext()} />;
case 22:
return ;
case 23:
return ;
case 24:
return ;
case 25:
return handleNext()} />;
case 26:
return ;
case 27:
return ;
case 28:
return ;
case 29:
return ;
case 30:
return handleNext()} />;
case 31:
return ;
case 32:
return ;
case 33:
return ;
case 34:
return ;
case 35:
return ;
case 36:
return ;
case 37:
return ;
case 38:
return ;
default:
return Form completed!
;
}
};
return (
{renderStep()}
);
};
export default EmployeeFormsController;