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

Function InsertTextMenuItem

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

Source from the content-addressed store, hash-verified

1329 * InsertTextMenuItem inserts plain text into the PromptField from within an InsertMenuButton.
1330 */
1331export 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
1345export interface CommandMenuItemProps extends Omit<
1346 MenuItemProps,

Callers

nothing calls this directly

Calls 2

useInsertPromptSegmentFunction · 0.85
insertFunction · 0.50

Tested by

no test coverage detected