(props: InsertTextMenuItemProps)
| 844 | > {} |
| 845 | |
| 846 | export function InsertTextMenuItem(props: InsertTextMenuItemProps) { |
| 847 | let insert = useInsertPromptSegment(item => [ |
| 848 | {type: 'text', text: `${'command' in item ? item.command : item.title} `} |
| 849 | ]); |
| 850 | |
| 851 | return ( |
| 852 | <MenuItem |
| 853 | {...props} |
| 854 | onAction={() => { |
| 855 | insert(props.value); |
| 856 | props.onAction?.(); |
| 857 | }} |
| 858 | /> |
| 859 | ); |
| 860 | } |
| 861 | |
| 862 | export interface CommandMenuItemProps extends Omit< |
| 863 | MenuItemProps, |
nothing calls this directly
no test coverage detected