import type { Block } from 'payload'

export const PhoneField: Block = {
  slug: 'phone',
  labels: {
    singular: 'Phone',
    plural: 'Phone',
  },
  fields: [
    {
      name: 'name',
      type: 'text',
      required: true,
      admin: {
        description: 'API key (e.g. phone). Do not change after launch.',
      },
    },
    {
      name: 'label',
      type: 'text',
      required: true,
      defaultValue: 'Phone Number',
    },
    {
      name: 'required',
      type: 'checkbox',
      defaultValue: false,
    },
    {
      name: 'defaultCountry',
      type: 'text',
      defaultValue: 'IN',
      admin: {
        description: 'ISO country code (e.g. IN, GB)',
      },
    },
    {
      name: 'width',
      type: 'select',
      defaultValue: '100',
      options: [
        { label: 'Full', value: '100' },
        { label: 'Half', value: '50' },
      ],
    },
  ],
}
