Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/features/workout-builder/ui/workout-stepper-footer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";
import { ArrowLeft, ArrowRight } from "lucide-react";
import { useRouter } from "next/navigation";

import { useI18n } from "locales/client";
import { Button } from "@/components/ui/button";
Expand All @@ -20,6 +21,7 @@ export function WorkoutBuilderFooter({
onStartWorkout?: VoidFunction;
}) {
const t = useI18n();
const router = useRouter();
const isFirstStep = currentStep === 1;
const isFinalStep = currentStep === totalSteps;

Expand All @@ -32,7 +34,13 @@ export function WorkoutBuilderFooter({
{/* Navigation buttons */}
<div className="mt-4 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 rounded-full min-h-12" disabled={isFirstStep} onClick={onPrevious} size="default" variant="ghost">
<Button
className="flex-1 rounded-full min-h-12"
disabled={isFirstStep}
onClick={() => router.back()}
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>
Expand Down