Skip to content

The open alternative to Salesforce, designed for AI.

401 B
Raw Blame
import { isNonEmptyString } from '@sniptt/guards';

export const getCountrySelectLabelledBy = ({
  ariaLabelledBy,
  ariaLabel,
  visibleLabelId,
}: {
  ariaLabelledBy?: string;
  ariaLabel?: string;
  visibleLabelId?: string;
}) => {
  if (isNonEmptyString(ariaLabelledBy)) {
    return ariaLabelledBy;
  }

  if (isNonEmptyString(ariaLabel)) {
    return undefined;
  }

  return visibleLabelId;
};