Skip to content

The open alternative to Salesforce, designed for AI.

639 B
Raw Blame
import { useLingui } from '@lingui/react/macro';
import { useTheme } from 'twenty-ui/theme';

type NoDataLayerProps = {
  innerWidth: number;
  innerHeight: number;
  hasNoData: boolean;
};

export const NoDataLayer = ({
  innerWidth,
  innerHeight,
  hasNoData,
}: NoDataLayerProps) => {
  const theme = useTheme();
  const { t } = useLingui();

  if (!hasNoData) {
    return null;
  }

  return (
    <text
      x={innerWidth / 2}
      y={innerHeight / 2}
      textAnchor="middle"
      dominantBaseline="middle"
      fill={theme.font.color.tertiary}
      fontSize={theme.font.size.md}
    >
      {t`No data`}
    </text>
  );
};