import type { PatternsFieldType } from '../../types/SchemaConfig';
import type { SelectableFieldTypes } from './types';

const SELECTABLE_FIELD_TYPES = new Set<PatternsFieldType>([
  'SHORT_TEXT',
  'NUMBER',
  'BOOLEAN',
  'DATE',
]);

export const isSelectableFieldType = (
  t: PatternsFieldType,
): t is SelectableFieldTypes => SELECTABLE_FIELD_TYPES.has(t);

export const isPIISupportedByFieldType = (
  t: SelectableFieldTypes | undefined,
): boolean => t === 'SHORT_TEXT';
