# `PhoenixKitProjects.Web.Components.WorkflowStatusFields`
[🔗](https://github.com/BeamLabEU/phoenix_kit_projects/blob/v0.14.0/lib/phoenix_kit_projects/web/components/workflow_status_fields.ex#L1)

The shared "Workflow status" form section (V125), reused by every form that
edits a project-like record: `ProjectFormLive`, `TemplateFormLive`, and
`AssignmentFormLive`'s sub-project mode. A sub-project and a template are both
projects, so they get the same status-source picker a project has.

The component renders the section; the module's plain functions
(`available?/0`, `entity_options/0`, `preview_for/1`, `mode_string/1`,
`apply_mode/3`, `selected_entity_uuid/1`) are the shared logic so each LV's
mount/validate/save stays a thin delegation. The "Generate default" button
emits `generate_default_statuses` — each LV owns that handler (it knows which
form to update).

# `apply_mode`

Folds the translated-titles 3-way choice into the `settings` JSONB on `attrs`,
preserving the record's other settings. `""` removes the per-record override
(inherit the global default).

# `available?`

True when the optional entities module backs the status feature.

# `entity_options`

Grouped status-source entity options for the `<.select>`.

# `mode_string`

The 3-way translated-titles control value ("true"/"false"/"") for a record.

# `preview_for`

The status rows the given entity (nil = shared default) would supply.

# `selected_entity_uuid`

The `status_entity_uuid` currently in the form (`nil` = shared default).

# `workflow_status_fields`

## Attributes

* `statuses_available` (`:boolean`) - Defaults to `false`.
* `field` (`:any`) (required) - the `status_entity_uuid` form field.
* `status_entities` (`:list`) - Defaults to `[]`.
* `status_preview` (`:list`) - Defaults to `[]`.
* `status_translation_mode` (`:string`) - Defaults to `""`.
* `locked` (`:boolean`) - true once the project has started — its statuses were cemented at start (`started_at` is the freeze boundary), so the source can no longer change. Defaults to `false`.

---

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