## class: `WyConversationHeader`, `wy-conversation-header`

Header section for a conversation. Displays title and optional conversation details with possibility to edit.

**Used sub components**

*   [`<wy-avatar>`](./ui/wy-avatar)
*   [`<wy-avatar-header>`](./ui/wy-avatar)
*   [`<wy-avatar-group>`](./ui/wy-avatar)
*   [`<wy-button>`](./ui/wy-button)
*   [`<wy-dropdown>`](./ui/wy-dropdown)
*   [`<wy-dropdown-item>`](./ui/wy-dropdown)
*   [`<wy-icon>`](./ui/wy-icon)
*   [`<wy-item>`](./ui/wy-item)
*   [`<wy-item-list>`](./ui/wy-item)
*   [`<wy-presence>`](./ui/wy-presence)
*   [`<wy-titlebar>`](./ui/wy-titlebar)
*   [`<wy-titlebar-text>`](./ui/wy-titlebar)
*   [`<wy-overlay>`](./ui/wy-overlay)
*   [`<wy-upload>`](./wy-upload)
*   [`<wy-users-search>`](./wy-users-search)

### Fields

| Name             | Type                   | Default | Description                                                                                      | Inherited From |
| ---------------- | ---------------------- | ------- | ------------------------------------------------------------------------------------------------ | -------------- |
| `conversationId` | `number \| undefined`  |         | The id of the current conversation.&#xA;&#xA;Set this to load or target a specific conversation. |                |
| `conversation`   | `AppType \| undefined` |         | Conversation data object for the current conversation.                                           |                |

### Methods

| Name        | Description                                          | Parameters | Return                       | Inherited From    |
| ----------- | ---------------------------------------------------- | ---------- | ---------------------------- | ----------------- |
| `whenReady` | Resolves when the component has rendered first time. |            | `Promise<WeavySubComponent>` | WeavySubComponent |

### Events

| Name        | Type                | Description                                          | Inherited From    |
| ----------- | ------------------- | ---------------------------------------------------- | ----------------- |
| `wy-action` | `WyActionEventType` | Emitted when the conversation is deselected/cleared. |                   |
| `ready`     | `CustomEvent`       | When the component has rendered.                     | WeavySubComponent |

### CSS Parts

| Name                                         | Description                                         |
| -------------------------------------------- | --------------------------------------------------- |
| `wy-conversation-titlebar`                   | The titlebar for the conversation.                  |
| `wy-conversation-details`                    | The conversation details overlay modal.             |
| `wy-conversation-add-members`                | The add members overlay modal.                      |
| `wy-scroll-y`                                | Scrollable content area inside the details overlay. |
| `wy-pane-group`                              | Grouping wrapper for room details fields.           |
| `wy-label`                                   | Labels for inputs in the details view.              |
| `wy-input`                                   | Inputs (room name) in the details view.             |
| `wy-description`                             | Description/help text in the details view.          |
| `wy-conversation-details-add-members-button` | Button for opening the add-members flow.            |

### Slots

| Name   | Description                                               |
| ------ | --------------------------------------------------------- |
| `icon` | Icon or button to display in the beginning of the header. |

<details><summary>Private API</summary>

### Fields

| Name                | Privacy | Type                                                  | Default                                                              | Description | Inherited From    |
| ------------------- | ------- | ----------------------------------------------------- | -------------------------------------------------------------------- | ----------- | ----------------- |
| `#resolveContextId` | private | `(contextId: ContextIdType) => void \| undefined`     |                                                                      |             | WeavySubComponent |
| `#whenContextId`    | private |                                                       | `new Promise<ContextIdType>((r) => { this.#resolveContextId = r; })` |             | WeavySubComponent |
| `#resolveUser`      | private | `(user: UserType) => void \| undefined`               |                                                                      |             | WeavySubComponent |
| `#whenUser`         | private |                                                       | `new Promise<UserType>((r) => { this.#resolveUser = r; })`           |             | WeavySubComponent |
| `#resolveWeavy`     | private | `(weavy: WeavyType) => void \| undefined`             |                                                                      |             | WeavySubComponent |
| `#whenWeavy`        | private |                                                       | `new Promise<WeavyType>((r) => { this.#resolveWeavy = r; })`         |             | WeavySubComponent |
| `#resolveReady`     | private | `(component: WeavySubComponent) => void \| undefined` |                                                                      |             | WeavySubComponent |
| `#whenReady`        | private |                                                       | `new Promise<WeavySubComponent>((r) => { this.#resolveReady = r; })` |             | WeavySubComponent |

### Methods

| Name            | Privacy   | Description                                                            | Parameters              | Return | Inherited From |
| --------------- | --------- | ---------------------------------------------------------------------- | ----------------------- | ------ | -------------- |
| `isAgentChat`   | protected | Checks whether the current or provided conversation is an agent chat.  | `conversation: AppType` |        |                |
| `isChatRoom`    | protected | Checks whether the current or provided conversation is a chat room.    | `conversation: AppType` |        |                |
| `isPrivateChat` | protected | Checks whether the current or provided conversation is a private chat. | `conversation: AppType` |        |                |

</details>

<hr/>

## Exports

| Kind                        | Name                     | Declaration          | Module                                   | Package |
| --------------------------- | ------------------------ | -------------------- | ---------------------------------------- | ------- |
| `js`                        | `WyConversationHeader`   | WyConversationHeader | lib/components/wy-conversation-header.ts |         |
| `custom-element-definition` | `wy-conversation-header` | WyConversationHeader | lib/components/wy-conversation-header.ts |         |
