import React from "react";
import { cn } from "@/lib/utils";

interface ValidationMessageProps {
  message?: string;
  isValid?: boolean;
  isLoading?: boolean;
  className?: string;
}

export function ValidationMessage({ message, isValid, isLoading, className }: ValidationMessageProps) {
  if (isLoading) {
    return <p className={cn("text-sm text-muted-foreground", className)}>검사 중...</p>;
  }

  if (!message) {
    return null;
  }

  return (
    <p className={cn("text-sm transition-colors", isValid ? "text-emerald-600" : "text-destructive", className)}>{message}</p>
  );
}
