import { defineComponent, h } from 'vue'

const COneTimePasswordInput = defineComponent({
  name: 'COneTimePasswordInput',
  inheritAttrs: false,
  setup(_, { attrs, slots }) {
    return () =>
      h(
        'input',
        {
          maxlength: 1,
          autocomplete: 'one-time-code',
          autocapitalize: 'off',
          autocorrect: 'off',
          spellcheck: false,
          ...attrs,
          class: ['form-otp-control', attrs.class],
        },
        slots.default && slots.default()
      )
  },
})

export { COneTimePasswordInput }
