import type { ExtractPropTypes, PropType } from 'vue'
import type { PickerOption } from 'vant'
import { timePickerProps } from 'vant'
export const horTimePickerProps = {
  ...timePickerProps,
  formatter: {
    type: Function as PropType<(type: string, option: PickerOption) => PickerOption>,
    default: (type: string, option: PickerOption): PickerOption => {
      if (type === 'hour') {
        option.text += '时'
      }
      if (type === 'minute') {
        option.text += '分'
      }
      if (type === 'seconds') {
        option.text += '分'
      }
      return option
    },
  },
}

export type HorTimePickerProps = ExtractPropTypes<typeof horTimePickerProps>
