openrag/frontend/app/onboarding/_components/progress-bar.tsx
Lucas Oliveira dce97c97e4
fix: make nudges and new conversations appear after onboarding, fix behavior on conversations (#418)
* fixed docker to old way

* added refetch when nudges are not fetched

* show skip overview just when finishing embedding

* just show children when show layout

* increased total onboarding steps

* made assistant message be saved on local storage to save progress on onboarding

* clean all items from local storage on finish onboarding

* only show navigation when onboarding is complete

* fixed navigation style to not placeholder for new conversation, not show loading state, and to show correct files

* fixed chat losing past message when navigating out of the chat

* fixed conversation be selected even though its a new conversation

* set the messages as just the user message when messages.length is 1

* fixed conversation be selected when exiting onboarding
2025-11-19 14:23:34 -03:00

49 lines
1.4 KiB
TypeScript

import { ArrowRight } from "lucide-react";
import { Button } from "@/components/ui/button";
interface ProgressBarProps {
currentStep: number;
totalSteps: number;
onSkip?: () => void;
}
export function ProgressBar({
currentStep,
totalSteps,
onSkip,
}: ProgressBarProps) {
const progressPercentage = ((currentStep + 1) / totalSteps) * 100;
return (
<div className="w-full flex items-center px-6 gap-4">
<div className="flex-1" />
<div className="flex items-center gap-3">
<div className="w-48 h-1 bg-background dark:bg-muted rounded-full overflow-hidden">
<div
className="h-full transition-all duration-300 ease-in-out"
style={{
width: `${progressPercentage}%`,
background: "linear-gradient(to right, #773EFF, #22A7AF)",
}}
/>
</div>
<span className="text-xs text-muted-foreground whitespace-nowrap">
{currentStep + 1}/{totalSteps}
</span>
</div>
<div className="flex-1 flex justify-end">
{currentStep > 1 && onSkip && (
<Button
variant="link"
size="sm"
onClick={onSkip}
className="flex items-center gap-2 text-mmd !text-placeholder-foreground hover:!text-foreground hover:!no-underline"
>
Skip overview
<ArrowRight className="w-4 h-4" />
</Button>
)}
</div>
</div>
);
}