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

Function InsertTokenMenuItem

packages/@react-spectrum/ai/src/PromptField.tsx:1297–1309  ·  view source on GitHub ↗
(props: InsertTokenMenuItemProps)

Source from the content-addressed store, hash-verified

1295 * InsertMenuButton.
1296 */
1297export function InsertTokenMenuItem(props: InsertTokenMenuItemProps) {
1298 let insert = useInsertPromptSegment([props.token]);
1299
1300 return (
1301 <MenuItem
1302 {...props}
1303 onAction={() => {
1304 insert();
1305 props.onAction?.();
1306 }}
1307 />
1308 );
1309}
1310
1311export interface InsertTextMenuItemProps extends Omit<
1312 MenuItemProps,

Callers

nothing calls this directly

Calls 2

useInsertPromptSegmentFunction · 0.85
insertFunction · 0.50

Tested by

no test coverage detected