"use client";
import { useEffect, useState } from "react";
import { StepFooterButton } from "@/components/onboarding/StepFooterButton";
import { ErrorBanner } from "@/components/ui/ErrorBanner";
import { FullScreenLoader } from "@/components/ui/FullScreenLoader";
import { OptionPicker } from "@/components/ui/OptionPicker";
import { getOptions, submitEducation, Option, FullProfile } from "@/lib/api";
import { formatApiError } from "@/lib/hooks";
function findSelection(profile: FullProfile | null, key: string): number[] {
return profile?.selections.find((s) => s.category_key === key)?.option_ids ?? [];
}
export function EducationStep({
initialProfile,
onNext,
}: {
initialProfile: FullProfile | null;
onNext: () => void;
}) {
const [levelOptions, setLevelOptions] = useState