Bin
2025-12-16 9e0b2ba2c317b1a86212f24cbae3195ad1f3dbfa
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import type React from "react";
import { IconExternal } from "@humansignal/ui";
 
interface EmptyStateProps {
  icon: React.ReactNode;
  header: string;
  description: React.ReactNode;
  learnMore?: {
    href: string;
    text: string;
    testId?: string;
  };
}
 
export const EmptyState: React.FC<EmptyStateProps> = ({ icon, header, description, learnMore }) => {
  // White-label check for docs link hiding
  // @ts-ignore
  const isWhiteLabel = typeof window !== "undefined" && window.APP_SETTINGS?.whitelabel_is_active === true;
 
  return (
    <div className="flex flex-col items-center justify-center gap-2 p-6 w-full" data-testid="empty-state">
      <div className="flex items-center justify-center bg-primary-background text-primary-icon rounded-full p-2 mb-2">
        {icon}
      </div>
      <div className="flex flex-col items-center w-full gap-1">
        <div
          className="font-medium text-body-medium leading-tight text-center text-neutral-content"
          data-testid="empty-state-header"
        >
          {header}
        </div>
        <div
          className="text-body-small text-neutral-content-subtler text-center w-full"
          data-testid="empty-state-description"
        >
          {description}
        </div>
      </div>
      {learnMore && !isWhiteLabel && (
        <div className="flex justify-center items-center w-full pt-tight mt-tight">
          <a
            href={learnMore.href}
            target="_blank"
            rel="noopener noreferrer"
            className="inline-flex items-center gap-1 text-body-small text-primary-link hover:underline"
            {...(learnMore.testId ? { "data-testid": learnMore.testId } : {})}
          >
            {learnMore.text}
            <IconExternal width={16} height={16} className="ml-1" />
          </a>
        </div>
      )}
    </div>
  );
};