# XWUICompanyWorkbench

A list-detail workbench for CRM companies/accounts, built on the same shape as
`XWUIContactWorkbench`: a roster pane (`basic/XWUIList`) selects into a detail
pane that composes `basic/XWUICardCompany` (logo, domain, industry, headcount,
revenue, location, owner, tags and the `stats` strip) and
`basic/XWUIQuickActions` (the Note/Task/Meeting/Log subset of
`XWUIQuickActions.DEFAULT_CRM_ACTIONS` - Call and Email are contact-level
actions and a company has no phone or inbox of its own).

Selection defaults to the first company and is controllable through
`data.selectedId`; an id that no longer matches a company in the roster falls
back to the first one rather than blanking the detail pane. A click on a roster
row, a call to `selectCompany(id)`, and a `host.data = {...}` write on the
custom element all go through the same path, and each emits
`data.onSelectCompany`. Quick actions emit `data.onQuickAction(company,
actionId)` with an `actionId` drawn from the shared CRM action ids, so an
activity logged here needs no remapping to appear in `XWUIActivityLogPanel`.

`data.error` beats `data.loading`, which beats `data.companies`: whichever wins
replaces the roster pane and leaves the detail pane empty, so a host wiring
this to a real fetch does not need a separate skeleton or error component.

Both detail widgets mount with `adoptRoot: true` - they style their own
container - so each sits inside an inner mount div declared `hostOwned: true`.
That inner div is load-bearing, not leftover: the outer
`.xwui-company-workbench-*-host` layout class is a token this projection wrote,
and `adopted-root-sheds-the-parent-projection` means an adopting child would
reconcile it away if the ref sat on the classed parent. See
`tests/0.core/test_adopt_root_wrapper_gate.test.ts` for the law and the
measurement.

This is the third component in `industry/crm/`, after `XWUIDealPipelineBoard`
and `XWUIContactWorkbench` - it is what `XWUISuperCRM` mounts for its
`crm-companies` menu leaf.

## Basic Usage

Three companies of mixed `type` with stats, tags and owners, so the card's
gated regions are visible on at least one of them.

```api
```
