|
@@ -1,5 +1,5 @@
|
|
|
"use client";
|
|
|
-import { ArrowLeft, ArrowRight, CheckCircle, Zap } from "lucide-react";
|
|
|
+import { ArrowLeft, ArrowRight } from "lucide-react";
|
|
|
|
|
|
import { useI18n } from "locales/client";
|
|
|
import { Button } from "@/components/ui/button";
|
|
@@ -10,6 +10,7 @@ export function WorkoutBuilderFooter({
|
|
|
canContinue,
|
|
|
onPrevious,
|
|
|
onNext,
|
|
|
+ onStartWorkout,
|
|
|
selectedEquipment,
|
|
|
selectedMuscles,
|
|
|
}: {
|
|
@@ -18,6 +19,7 @@ export function WorkoutBuilderFooter({
|
|
|
canContinue: boolean;
|
|
|
onPrevious: VoidFunction;
|
|
|
onNext: VoidFunction;
|
|
|
+ onStartWorkout?: VoidFunction;
|
|
|
selectedEquipment: any[];
|
|
|
selectedMuscles: any[];
|
|
|
}) {
|
|
@@ -26,99 +28,37 @@ export function WorkoutBuilderFooter({
|
|
|
const isFinalStep = currentStep === totalSteps;
|
|
|
|
|
|
return (
|
|
|
- <div className="w-full">
|
|
|
+ <div className="w-full sticky bottom-0 z-10">
|
|
|
{/* Mobile layout - vertical stack */}
|
|
|
- <div className="flex flex-col gap-4 md:hidden">
|
|
|
+ <div className="flex flex-col gap-4 px-2 sm:px-6 pb-2">
|
|
|
{/* Center stats on top for mobile */}
|
|
|
- <div className="flex items-center justify-center">
|
|
|
- <div className="flex items-center gap-4 bg-white dark:bg-slate-800 px-4 py-2 rounded-full dark:border-slate-700 shadow-sm">
|
|
|
- {currentStep === 1 && (
|
|
|
- <div className="flex items-center gap-2 text-sm">
|
|
|
- <Zap className="h-4 w-4 text-emerald-500" />
|
|
|
- <span className="font-medium text-slate-700 dark:text-slate-300">
|
|
|
- {t("workout_builder.stats.equipment_selected", { count: selectedEquipment.length })}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- )}
|
|
|
- {currentStep === 2 && (
|
|
|
- <div className="flex items-center gap-2 text-sm">
|
|
|
- <CheckCircle className="h-4 w-4 text-blue-500" />
|
|
|
- <span className="font-medium text-slate-700 dark:text-slate-300">
|
|
|
- {t("workout_builder.stats.muscle_selected", { count: selectedMuscles.length })}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- )}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <div className="flex items-center justify-center"></div>
|
|
|
|
|
|
{/* Navigation buttons */}
|
|
|
- <div className="flex items-center justify-between gap-3">
|
|
|
+ <div className="min-h-12 flex items-center justify-between gap-3 bg-white dark:bg-slate-900 w-full p-0.5 border border-slate-400 dark:border-slate-700 rounded-full">
|
|
|
{/* Previous button */}
|
|
|
- <Button className="flex-1" disabled={isFirstStep} onClick={onPrevious} size="default" variant="ghost">
|
|
|
+ <Button className="flex-1 rounded-full min-h-12" disabled={isFirstStep} onClick={onPrevious} size="default" variant="ghost">
|
|
|
<div className="flex items-center gap-2">
|
|
|
<ArrowLeft className="h-4 w-4" />
|
|
|
<span className="font-medium">{t("workout_builder.navigation.previous")}</span>
|
|
|
</div>
|
|
|
</Button>
|
|
|
|
|
|
- {/* Next/Complete button */}
|
|
|
+ {/* Next/Start Workout button */}
|
|
|
<Button
|
|
|
- className="flex-1"
|
|
|
+ className="flex-1 rounded-full bg-blue-600 hover:bg-blue-700 min-h-12 dark:bg-blue-500 dark:hover:bg-blue-600"
|
|
|
disabled={!canContinue}
|
|
|
- onClick={isFinalStep ? () => console.log("Complete workout!") : onNext}
|
|
|
+ onClick={isFinalStep ? () => onStartWorkout?.() : onNext}
|
|
|
size="default"
|
|
|
variant="default"
|
|
|
>
|
|
|
<div className="flex items-center justify-center gap-2">
|
|
|
- <span className="font-semibold">
|
|
|
- {isFinalStep ? t("workout_builder.navigation.complete") : t("workout_builder.navigation.continue")}
|
|
|
- </span>
|
|
|
- {!isFinalStep && <ArrowRight className="h-4 w-4" />}
|
|
|
- {isFinalStep && <CheckCircle className="h-4 w-4" />}
|
|
|
+ <span className="font-semibold">{t("workout_builder.navigation.continue")}</span>
|
|
|
+ <ArrowRight className="h-4 w-4" />
|
|
|
</div>
|
|
|
</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- {/* Desktop layout - horizontal */}
|
|
|
- <div className="hidden md:flex items-center justify-between">
|
|
|
- {/* Previous button */}
|
|
|
- <Button disabled={isFirstStep} onClick={onPrevious} size="large" variant="ghost">
|
|
|
- <div className="flex items-center gap-2">
|
|
|
- <ArrowLeft className="h-4 w-4 transition-transform group-hover:-translate-x-1" />
|
|
|
- <span className="font-medium">{t("workout_builder.navigation.previous")}</span>
|
|
|
- </div>
|
|
|
- </Button>
|
|
|
-
|
|
|
- {/* Center stats */}
|
|
|
- <div className="flex items-center gap-4 bg-white dark:bg-slate-800 px-6 py-3 rounded-full dark:border-slate-700 shadow-sm">
|
|
|
- {currentStep === 1 && (
|
|
|
- <div className="flex items-center gap-2 text-sm">
|
|
|
- <Zap className="h-4 w-4 text-emerald-500" />
|
|
|
- <span className="font-medium text-slate-700 dark:text-slate-300">
|
|
|
- {t("workout_builder.stats.equipment_selected", { count: selectedEquipment.length })}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- )}
|
|
|
- {currentStep === 2 && (
|
|
|
- <div className="flex items-center gap-2 text-sm">
|
|
|
- <CheckCircle className="h-4 w-4 text-blue-500" />
|
|
|
- <span className="font-medium text-slate-700 dark:text-slate-300">
|
|
|
- {t("workout_builder.stats.muscle_selected", { count: selectedMuscles.length })}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- )}
|
|
|
- {/* Next step */}
|
|
|
- </div>
|
|
|
- {currentStep !== 3 && (
|
|
|
- <Button disabled={!canContinue} onClick={onNext} size="large" variant="default">
|
|
|
- <div className="flex items-center gap-2">
|
|
|
- <span className="font-medium">{t("commons.next")}</span>
|
|
|
- <ArrowRight className="h-4 w-4 transition-transform group-hover:-translate-x-1" />
|
|
|
- </div>
|
|
|
- </Button>
|
|
|
- )}
|
|
|
- </div>
|
|
|
</div>
|
|
|
);
|
|
|
}
|