this is the 3rd step

This commit is contained in:
Leon Serfaty G
2025-07-17 10:09:34 +00:00
parent 6a6e7841e3
commit 1e109c3af7
3 changed files with 102 additions and 3 deletions
@@ -3,12 +3,14 @@
import React, { useState, useTransition } from 'react';
import { Step1ProjectType } from './step-1-project-type';
import { Step2ServiceType } from './step-2-service-type';
import { Step3ProjectStage } from './step-3-project-stage';
import { Card, CardContent } from '@/components/ui/card';
import { AnimatePresence, motion } from 'framer-motion';
export type FormData = {
projectType: 'website' | 'mobile-app' | 'platform' | null;
serviceType: 'entire-project' | 'development' | 'ui-ux-design' | 'identity-branding' | null;
projectStage: number;
};
export function CostEstimatorForm() {
@@ -16,6 +18,7 @@ export function CostEstimatorForm() {
const [formData, setFormData] = useState<FormData>({
projectType: null,
serviceType: null,
projectStage: 0,
});
const [isPending, startTransition] = useTransition();
@@ -25,6 +28,12 @@ export function CostEstimatorForm() {
});
};
const handlePrevStep = () => {
startTransition(() => {
setCurrentStep((prev) => prev - 1);
});
};
const handleUpdateFormData = (newData: Partial<FormData>) => {
setFormData((prev) => ({ ...prev, ...newData }));
};
@@ -42,7 +51,18 @@ export function CostEstimatorForm() {
return (
<Step2ServiceType
onNext={handleNextStep}
onBack={handlePrevStep}
onUpdateData={handleUpdateFormData}
formData={formData}
/>
);
case 3:
return (
<Step3ProjectStage
onNext={handleNextStep}
onBack={handlePrevStep}
onUpdateData={handleUpdateFormData}
formData={formData}
/>
);
default: