Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

831 B
Raw Blame
import { Check, Copy, X } from "lucide-react";
import { cn } from "@/lib/cn";
import type { CopyFeedback } from "@/lib/copy-text";

/** Copy, Check or X in one slot; only the feedback icons play in. */
export function CopyFeedbackIcon({ state, size = 14, strokeWidth, className }: { state: CopyFeedback; size?: number; strokeWidth?: number; className?: string }) {
  if (state === "failed") {
    return <X key="failed" size={size} strokeWidth={strokeWidth} className={cn("animate-icon-morph text-danger", className)} aria-hidden="true" />;
  }
  if (state === "copied") {
    return <Check key="copied" size={size} strokeWidth={strokeWidth} className={cn("check-in text-success", className)} aria-hidden="true" />;
  }
  return <Copy key="idle" size={size} strokeWidth={strokeWidth} className={className} aria-hidden="true" />;
}