import {
  FieldType,
} from '@airtable/blocks/models';

import { PhoneField,FloatField } from './AirtableFields';

import {
  BarcodeField,
  CheckboxField,
  CurrencyField,
  DatetimeField,
  EmailField,
  IntegerField,
  MultiLineTextField,
  MultipleRecordLinksField,
  MultipleSelectsField,
  SingleLineTextField,
  SingleSelectField,
  UrlField,
} from '.';

export const singleLineText:SingleLineTextField = {
  type: FieldType.SINGLE_LINE_TEXT,
  options: null,
} as const;

export const id:SingleLineTextField = {
  type: FieldType.SINGLE_LINE_TEXT,
  options: null,
};

export const phoneNumber:PhoneField = {
  type: FieldType.PHONE_NUMBER,
  options: null
};

export const datetime:DatetimeField = {
  type: FieldType.DATE_TIME,
  options: {
    dateFormat: {
      name: 'local',
      format: 'l'
    },
    timeFormat: {
      name: '12hour',
      format: 'h:mma'
    },
    timeZone: 'client',
  },
};

export const barcode:BarcodeField = {
  type: FieldType.BARCODE,
  options: null,
};

export const json:MultiLineTextField = {
  type: FieldType.MULTILINE_TEXT,
  options: null,
};

export const multiLineText:MultiLineTextField = {
  type: FieldType.MULTILINE_TEXT,
  options: null,
};
export const email:EmailField = {
  type: FieldType.EMAIL,
  options: null,
};
export const url:UrlField = {
  type: FieldType.URL,
  options: null,
};
export const checkbox:CheckboxField = {
  type: FieldType.CHECKBOX,
  options: {
    icon: 'check',
    color: 'greenBright',
  },
};
export const integer:IntegerField = {
  type: FieldType.NUMBER,
  options: {
    precision: 0,
  },
};
export const float:FloatField = {
  type: FieldType.NUMBER,
  options: {
    precision: 2,
  },
};
export const latLong:FloatField = {
  type: FieldType.NUMBER,
  options: {
    precision: 5,
  },
};
export const singleSelect:SingleSelectField = {
  type: FieldType.SINGLE_SELECT,
  options: {
    choices: [],
  },
};
export const multipleSelects:MultipleSelectsField = {
  type: FieldType.MULTIPLE_SELECTS,
  options: {
    choices: [],
  },
};
export const currency:CurrencyField = {
  type: FieldType.CURRENCY,
  options: {
    precision: 2,
    symbol: '',
  }
};
export const multipleRecordLinks: MultipleRecordLinksField = {
  type: FieldType.MULTIPLE_RECORD_LINKS,
  options: {

  }
};