import React from 'react'; import { Form, Input, Typography, Button, Progress, Space } from '@/shared/antd-imports'; import { useDispatch, useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; import { setSurveyData, setSurveySubStep } from '@/features/account-setup/account-setup.slice'; import { RootState } from '@/app/store'; import { OrganizationType, UserRole, UseCase, HowHeardAbout, IAccountSetupSurveyData } from '@/types/account-setup/survey.types'; const { Title, Paragraph } = Typography; const { TextArea } = Input; interface Props { onEnter: () => void; styles: any; isDarkMode: boolean; token?: any; } interface SurveyPageProps { styles: any; isDarkMode: boolean; token?: any; surveyData: IAccountSetupSurveyData; handleSurveyDataChange: (field: keyof IAccountSetupSurveyData, value: any) => void; handleUseCaseToggle?: (value: UseCase) => void; } // Page 1: About You const AboutYouPage: React.FC = ({ styles, token, surveyData, handleSurveyDataChange }) => { const { t } = useTranslation('account-setup'); const organizationTypeOptions: { value: OrganizationType; label: string; icon?: string }[] = [ { value: 'freelancer', label: t('organizationTypeFreelancer'), icon: '👤' }, { value: 'startup', label: t('organizationTypeStartup'), icon: '🚀' }, { value: 'small_medium_business', label: t('organizationTypeSmallMediumBusiness'), icon: '🏢' }, { value: 'agency', label: t('organizationTypeAgency'), icon: '🎯' }, { value: 'enterprise', label: t('organizationTypeEnterprise'), icon: '🏛️' }, { value: 'other', label: t('organizationTypeOther'), icon: '📋' }, ]; const userRoleOptions: { value: UserRole; label: string; icon?: string }[] = [ { value: 'founder_ceo', label: t('userRoleFounderCeo'), icon: '👔' }, { value: 'project_manager', label: t('userRoleProjectManager'), icon: '📊' }, { value: 'software_developer', label: t('userRoleSoftwareDeveloper'), icon: '💻' }, { value: 'designer', label: t('userRoleDesigner'), icon: '🎨' }, { value: 'operations', label: t('userRoleOperations'), icon: '⚙️' }, { value: 'other', label: t('userRoleOther'), icon: '✋' }, ]; return (
{t('aboutYouStepTitle')} {t('aboutYouStepDescription')}
{/* Organization Type */}
{organizationTypeOptions.map((option) => { const isSelected = surveyData.organization_type === option.value; return ( ); })}
{/* User Role */}
{userRoleOptions.map((option) => { const isSelected = surveyData.user_role === option.value; return ( ); })}
); }; // Page 2: Your Needs const YourNeedsPage: React.FC = ({ styles, token, surveyData, handleSurveyDataChange, handleUseCaseToggle }) => { const { t } = useTranslation('account-setup'); const useCaseOptions: { value: UseCase; label: string; description: string }[] = [ { value: 'task_management', label: t('mainUseCasesTaskManagement'), description: 'Organize and track tasks' }, { value: 'team_collaboration', label: t('mainUseCasesTeamCollaboration'), description: 'Work together seamlessly' }, { value: 'resource_planning', label: t('mainUseCasesResourcePlanning'), description: 'Manage time and resources' }, { value: 'client_communication', label: t('mainUseCasesClientCommunication'), description: 'Stay connected with clients' }, { value: 'time_tracking', label: t('mainUseCasesTimeTracking'), description: 'Monitor project hours' }, { value: 'other', label: t('mainUseCasesOther'), description: 'Something else' }, ]; const onUseCaseClick = (value: UseCase) => { if (handleUseCaseToggle) { handleUseCaseToggle(value); } else { const currentUseCases = surveyData.main_use_cases || []; const isSelected = currentUseCases.includes(value); const newUseCases = isSelected ? currentUseCases.filter(useCase => useCase !== value) : [...currentUseCases, value]; handleSurveyDataChange('main_use_cases', newUseCases); } }; return (
{t('yourNeedsStepTitle')} {t('yourNeedsStepDescription')}
{/* Main Use Cases */}
{useCaseOptions.map((option) => { const isSelected = (surveyData.main_use_cases || []).includes(option.value); return ( ); })}
{surveyData.main_use_cases && surveyData.main_use_cases.length > 0 && (

{surveyData.main_use_cases.length} {t('selected')}

)}
{/* Previous Tools */}