## class: `WyConversationItem`, `wy-conversation-item`

Item display of a conversation for use in lists.

**Used sub components**

*   [`<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-avatar>`](./ui/wy-avatar)
*   [`<wy-avatar-group>`](./ui/wy-avatar)
*   [`<wy-typing>`](./wy-typing)

### Fields

| Name             | Type                  | Default | Description                                                                                                                                                                                                                                                                                             | Inherited From |
| ---------------- | --------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| `conversationId` | `number \| undefined` |         | The id of the conversation.&#xA;&#xA;Use this to identify which conversation the item represents.                                                                                                                                                                                                       |                |
| `unread`         | `boolean`             | `false` | Whether the conversation is unread.                                                                                                                                                                                                                                                                     |                |
| `avatarUrl`      | `string \| undefined` | `""`    | Url to any custom avatar for the conversation. If omitted, member avatars are used.                                                                                                                                                                                                                     |                |
| `hideAvatar`     | `boolean`             | `false` | Whether the avatar should be hidden.                                                                                                                                                                                                                                                                    |                |
| `name`           | `string`              | `""`    | Any custom title for the conversation item.                                                                                                                                                                                                                                                             |                |
| `type`           | `AppTypeGuid`         |         | The type guid of the conversation.                                                                                                                                                                                                                                                                      |                |
| `selected`       | `boolean`             | `false` | Whether the conversation item is selected.                                                                                                                                                                                                                                                              |                |
| `starred`        | `boolean`             | `false` | Whether the conversation is starred.                                                                                                                                                                                                                                                                    |                |
| `pinned`         | `boolean`             | `false` | Whether the conversation is pinned.                                                                                                                                                                                                                                                                     |                |
| `blocked`        | `boolean`             | `false` | Whether this is a private chat with a blocked user.&#xA;&#xA;A blocked conversation goes quiet: it is dimmed, shows no preview or unread, and offers unblock as its only action.&#xA;It still opens, onto the blocked notice rather than the chat. Nothing is deleted -- unblocking brings it all back. |                |
| `canBlock`       | `boolean`             | `false` | Whether blocking is offered for this conversation.&#xA;&#xA;Set by the parent list, since this component has no feature policy of its own. Gates blocking only -- unblock&#xA;stays available, so turning the feature off cannot strand someone with a block they can no longer undo.                   |                |

### Methods

| Name               | Description                 | Parameters      | Return | Inherited From |
| ------------------ | --------------------------- | --------------- | ------ | -------------- |
| `dispatchSelected` | Trigger \`selected\` event. |                 |        |                |
| `dispatchStar`     | Trigger \`star\` event.     | `star: boolean` |        |                |

### Events

| Name       | Type                    | Description                                                                   | Inherited From |
| ---------- | ----------------------- | ----------------------------------------------------------------------------- | -------------- |
| `selected` | `SelectedEventType`     | Emitted when the conversation item is selected.                               |                |
| `star`     | `StarEventType`         | Emitted when the star/unstar action is requested.                             |                |
| `pin`      | `PinEventType`          | Emitted when the pin/unpin action is requested.                               |                |
| `mark`     | `MessagesMarkEventType` | Emitted when the conversation should be marked read/unread.                   |                |
| `leave`    | `LeaveEventType`        | Emitted when the current user requests to leave the conversation.             |                |
| `remove`   | `RemoveEventType`       | Emitted when the conversation should be removed/deleted.                      |                |
| `trash`    | `TrashEventType`        | Emitted when the conversation should be trashed.                              |                |
| `block`    | `BlockEventType`        | Emitted when the other user in a private chat should be blocked or unblocked. |                |

### Attributes

| Name             | Field          | Inherited From |
| ---------------- | -------------- | -------------- |
| `conversationId` | conversationId |                |
| `unread`         | unread         |                |
| `avatarUrl`      | avatarUrl      |                |
| `hideAvatar`     | hideAvatar     |                |
| `name`           | name           |                |
| `type`           | type           |                |
| `selected`       | selected       |                |
| `starred`        | starred        |                |
| `pinned`         | pinned         |                |
| `blocked`        | blocked        |                |
| `canBlock`       | canBlock       |                |

### CSS Parts

| Name                          | Description                                                           |
| ----------------------------- | --------------------------------------------------------------------- |
| `wy-conversation-item`        | The conversation item container (applied on the inner wy-item)        |
| `wy-conversation-item-avatar` | The conversation avatar, whichever of the three variants is rendered. |

<hr/>

## Exports

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