Files
fusion/packages/dashboard/app/components/OnboardingResumeCard.tsx
gsxdsm 5ba08aee22 feat(FN-1704): add onboarding resume card for dismissed modals
- Add OnboardingResumeCard component shown when onboarding was dismissed but not completed
- Store onboarding step state in localStorage for session persistence
- Update App.tsx to render resume card when onboarding is resumable
- Add comprehensive tests for model-onboarding-state utility functions
- Add tests for OnboardingResumeCard component and App integration
- Use onResume callback pattern for consistency with modal API
2026-04-14 15:41:00 -07:00

51 lines
1.6 KiB
TypeScript

import { Play, Sparkles } from "lucide-react";
import { getOnboardingResumeStep } from "./model-onboarding-state";
interface OnboardingResumeCardProps {
/** Called when the user clicks "Continue onboarding" */
onResume: () => void;
}
/**
* A banner/card that appears when a user has previously started onboarding
* but dismissed the modal without completing. It allows them to resume
* from where they left off.
*/
export function OnboardingResumeCard({ onResume }: OnboardingResumeCardProps) {
const resumeStep = getOnboardingResumeStep();
// Should not render if no resumable state exists
if (!resumeStep) {
return null;
}
return (
<section
className="onboarding-resume-card"
role="region"
aria-label="Resume onboarding"
>
<div className="onboarding-resume-card__main">
<div className="onboarding-resume-card__icon" aria-hidden="true">
<Sparkles size={20} />
</div>
<div className="onboarding-resume-card__content">
<h2 className="onboarding-resume-card__title">Continue Setup</h2>
<p className="onboarding-resume-card__description">
You&apos;re on the <strong>{resumeStep.label}</strong> step. Continue where you left off to complete your dashboard setup.
</p>
</div>
</div>
<div className="onboarding-resume-card__actions">
<button
className="onboarding-resume-card__resume-btn"
onClick={onResume}
>
<Play size={14} aria-hidden="true" />
<span>Continue onboarding</span>
</button>
</div>
</section>
);
}