MCPcopy Create free account
hub / github.com/adobe/react-spectrum / InsertTextMenuItem

Function InsertTextMenuItem

packages/@react-spectrum/ai/src/PromptField.tsx:846–860  ·  view source on GitHub ↗
(props: InsertTextMenuItemProps)

Source from the content-addressed store, hash-verified

844> {}
845
846export 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
862export interface CommandMenuItemProps extends Omit<
863 MenuItemProps,

Callers

nothing calls this directly

Calls 2

useInsertPromptSegmentFunction · 0.85
insertFunction · 0.50

Tested by

no test coverage detected