File size: 394 Bytes
3201ca6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import React from "react";

interface ErrorMessageProps {
  isError: boolean;
  message?: string;
  testId?: string;
}

export function ErrorMessage({
  isError,
  message = "Failed to load data",
  testId = "dropdown-error",
}: ErrorMessageProps) {
  if (!isError) return null;

  return (
    <div className="text-red-500 text-sm mt-1" data-testid={testId}>
      {message}
    </div>
  );
}