import { Rate as VanRate } from 'vant'
import { useFormInput } from '../../../hooks/form-input'
import {formInputProps, fromInputEmits} from '../../form-input-props'
import { useRateConfig } from './use-rate-config'
export default {
  props: formInputProps,
  emits: [...fromInputEmits],
  setup (props, context) {
    const formInput = useFormInput(props, context)
    const { proxyValue } = formInput
    const { allowHalf, max } = useRateConfig(formInput)
    return () => <div>
      <VanRate v-model={proxyValue.value}
        count={max.value}
        allowHalf={allowHalf.value}
        void-icon="star"
        color="#ffd21e"
      />
    </div>
  }
}
