24 lines
577 B
TypeScript
24 lines
577 B
TypeScript
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-gray-500", className)}>검사 중...</p>;
|
|
}
|
|
|
|
if (!message) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<p className={cn("text-sm transition-colors", isValid ? "text-green-600" : "text-red-600", className)}>{message}</p>
|
|
);
|
|
}
|