import React from 'react'
import { Input, InputNumber } from 'antd'

export default (props) => {
  const { addonAfter, ...leftProps } = props;

  if (!addonAfter) {
    return <InputNumber {...leftProps} />
  }

  return (
    <Input.Group compact>
      <InputNumber style={{ width: 'calc(100% - 3em - 1px)' }} {...leftProps} />
      <Input value={addonAfter} disabled style={{ width: '3em' }} />
    </Input.Group>
  )
}
