defmodule Berrypod.Pages.SettingsField do
  @moduledoc "Defines a single field in a block's settings schema."

  @type field_type :: :text | :textarea | :number | :select | :repeater
  @type t :: %__MODULE__{
          key: String.t(),
          label: String.t(),
          type: field_type(),
          default: term(),
          options: [String.t()] | nil,
          item_schema: [t()] | nil
        }

  @enforce_keys [:key, :label, :type]
  defstruct [:key, :label, :type, default: nil, options: nil, item_schema: nil]
end
