(props: InsertTextMenuItemProps)
| 1329 | * InsertTextMenuItem inserts plain text into the PromptField from within an InsertMenuButton. |
| 1330 | */ |
| 1331 | export function InsertTextMenuItem(props: InsertTextMenuItemProps) { |
| 1332 | let insert = useInsertPromptSegment([{type: 'text', text: props.text}]); |
| 1333 | |
| 1334 | return ( |
| 1335 | <MenuItem |
| 1336 | {...props} |
| 1337 | onAction={() => { |
| 1338 | insert(); |
| 1339 | props.onAction?.(); |
| 1340 | }} |
| 1341 | /> |
| 1342 | ); |
| 1343 | } |
| 1344 | |
| 1345 | export interface CommandMenuItemProps extends Omit< |
| 1346 | MenuItemProps, |
nothing calls this directly
no test coverage detected