All files / src/lib/uploads UploadActivityStatus.tsx

100% Statements 2/2
88.88% Branches 8/9
100% Functions 0/0
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30                        313x     25x                            
import { Loader2 } from "lucide-react";
 
type UploadActivityStatusProps = {
  activeLabel: string | null;
  inactiveLabel?: string | null;
};
 
/** Render a shared live status row for active CSV upload/import work. */
export function UploadActivityStatus({
  activeLabel,
  inactiveLabel = null,
}: UploadActivityStatusProps) {
  const label = activeLabel ?? inactiveLabel;
 
  if (!label) {
    return null;
  }
 
  return (
    <div
      className="flex items-center gap-2 text-xs text-muted-foreground"
      role={activeLabel ? "status" : undefined}
      aria-live={activeLabel ? "polite" : undefined}
    >
      {activeLabel && <Loader2 className="h-3.5 w-3.5 shrink-0 animate-spin" />}
      <p>{label}</p>
    </div>
  );
}