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

interface Props {
  field: ReadonlyField;
  value: unknown;
  item: Record<string, unknown> | null;
}

const { field, value, item } = Astro.props;
const display = field.render ? field.render(value, item) : (value == null ? '—' : String(value));
---

<div class="bs-readonly" id={`f-${field.key}`}>{display}</div>
