(props: InsertTokenMenuItemProps)
| 813 | > {} |
| 814 | |
| 815 | export function InsertTokenMenuItem(props: InsertTokenMenuItemProps) { |
| 816 | let insert = useInsertPromptSegment(item => [ |
| 817 | {type: 'token', text: 'command' in item ? item.command : item.title, value: item}, |
| 818 | {type: 'text', text: ' '} |
| 819 | ]); |
| 820 | |
| 821 | return ( |
| 822 | <MenuItem |
| 823 | {...props} |
| 824 | onAction={() => { |
| 825 | insert(props.value); |
| 826 | props.onAction?.(); |
| 827 | }} |
| 828 | /> |
| 829 | ); |
| 830 | } |
| 831 | |
| 832 | export interface InsertTextMenuItemProps extends Omit< |
| 833 | MenuItemProps, |
nothing calls this directly
no test coverage detected