# MessageActions

> Copy, regenerate, like and dislike for an assistant message.

Source: https://ui.jcsoftdev.com/docs/components/message-actions

Copy, regenerate, like and dislike for an assistant message. Feedback toggles off on re-press.

## Import

```ts
import { MessageActions } from "@jcsoftdev/ui/ai";
```

Single-component entry points tree-shake to just this component: `@jcsoftdev/ui/ai/message-actions`.

## Usage

```tsx
<MessageActions
  text="Tienes tres huecos libres mañana: 10:00, 11:30 y 16:00."
/>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `text` * | `string` |  | Text copied by the copy button. |
| `onCopy` | `((text: string) => void)` |  |  |
| `onRegenerate` | `(() => void)` |  | Omit to hide the regenerate button. |
| `onFeedback` | `((value: MessageFeedback) => void)` |  | Omit to hide the like/dislike buttons. |
| `feedback` | `null \| "like" \| "dislike"` |  |  |
| `defaultFeedback` | `null \| "like" \| "dislike"` | `null` |  |

`*` marks a required prop.

It also accepts the native props of the element or primitive it renders (for example `className`, `id`, `aria-*` and event handlers).

## Storybook stories

- [Default](/storybook/?path=/story/ai-messageactions--default)
- [Liked](/storybook/?path=/story/ai-messageactions--liked)
- [Copy Only](/storybook/?path=/story/ai-messageactions--copy-only)
- [Narrow](/storybook/?path=/story/ai-messageactions--narrow)
- [Preset Brutal](/storybook/?path=/story/ai-messageactions--preset-brutal)

## Source

`packages/ui/src/ai/message-actions/message-actions.tsx`
