# `PhoenixKitWarehouse.Web.Components.CommentsPanel`
[🔗](https://github.com/BeamLabEU/phoenix_kit_warehouse/blob/0.4.0/lib/phoenix_kit_warehouse/web/components/comments_panel.ex#L1)

Presentation helper for warehouse document comment threads. `panel/1`
embeds the ready-made `PhoenixKitComments.Web.CommentsComponent`.

Consolidates what were 5 near-identical files in Andi
(`AndiWeb.Components.{InternalOrder,GoodsIssue,GoodsReceipt,SupplierOrder,
Inventory}Comments`, under `lib/andi_web/components/` — distinct from the
5 *context* wrapper modules of the same base names that
`PhoenixKitWarehouse.Comments` already consolidates) into one module
parameterized by `kind`, mirroring `PhoenixKitWarehouse.Comments`' own
`kind :: :goods_issue | :goods_receipt | :internal_order | :supplier_order
| :inventory | :transfer` parameterization (`:transfer` added later,
Plan 4/T15 — no Andi predecessor).

Callers guard visibility with `PhoenixKitWarehouse.Comments.available?/0`.

# `panel`

Embedded comments thread for a warehouse document.

Assigns:
  * `:kind` — `:goods_issue | :goods_receipt | :internal_order |
    :supplier_order | :inventory | :transfer` (required)
  * `:resource_uuid` — the document's uuid, used as `resource_uuid`
    (required)
  * `:current_user` — current user struct (or nil) (required)
  * `:id` — optional DOM id; defaults to `comments-<kind>-<uuid>`
  * `:title` — optional heading; defaults to `""`
  * `:read_only` — when true, render without composer or chrome

## Attributes

* `kind` (`:atom`) (required) - Must be one of `:goods_issue`, `:goods_receipt`, `:internal_order`, `:supplier_order`, `:inventory`, or `:transfer`.
* `resource_uuid` (`:string`) (required)
* `current_user` (`:any`) (required)
* `id` (`:string`) - Defaults to `nil`.
* `title` (`:string`) - Defaults to `""`.
* `read_only` (`:boolean`) - Defaults to `false`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
