import * as React from "react"; import { cn } from "@/lib/utils"; import { Button } from "@/components/ui/button"; export type ApplicantNavigationBarApplicant = { name: string; }; export type ApplicantNavigationBarProps = { applicants: ApplicantNavigationBarApplicant[]; currentIndex: number; /** Ordered list of applicant indices to navigate between. */ displayOrder?: number[]; onPrev?: () => void; onNext?: () => void; /** Called when there is no next applicant (last in order). */ onSaveAndNext?: () => void; saveLabel?: string; className?: string; }; export function ApplicantNavigationBar({ applicants, currentIndex, displayOrder, onPrev, onNext, onSaveAndNext, saveLabel = "Save & Next", className, }: ApplicantNavigationBarProps) { const order = displayOrder ?? applicants.map((_, i) => i); const position = order.indexOf(currentIndex); const pos = position >= 0 ? position : 0; const isFirst = pos === 0; const isLast = pos === order.length - 1; const hasMultiple = applicants.length > 1; return (
{hasMultiple && !isFirst ? ( ) : ( )} {hasMultiple && !isLast ? ( ) : ( )}
); } function ChevronLeftIcon({ className }: { className?: string }) { return ( ); } function ChevronRightIcon({ className }: { className?: string }) { return ( ); }