---
import type { NumberField } from '../../resource-types';

interface Props {
  field: NumberField;
  value: unknown;
}

const { field, value } = Astro.props;
const v = value == null ? '' : String(value);
---

<input
  type="number"
  id={`f-${field.key}`}
  name={field.key}
  class="bs-input"
  value={v}
  min={field.min}
  max={field.max}
  step={field.step}
  required={field.required}
  readonly={field.readOnly}
/>
