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

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

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

<input
  type="text"
  id={`f-${field.key}`}
  name={field.key}
  class="bs-input"
  value={v}
  placeholder={field.placeholder ?? ''}
  maxlength={field.maxLength}
  required={field.required}
  readonly={field.readOnly}
/>
