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

Function CommandMenuItem

packages/@react-spectrum/ai/src/PromptField.tsx:878–889  ·  view source on GitHub ↗
(props: CommandMenuItemProps)

Source from the content-addressed store, hash-verified

876// since they dont end up inserting a token or text, we need to clear the partial text that the user used
877// to filter the menu
878export function CommandMenuItem(props: CommandMenuItemProps) {
879 let insert = useInsertPromptSegment(() => []);
880 return (
881 <MenuItem
882 {...props}
883 onAction={() => {
884 insert(undefined);
885 props.onAction?.();
886 }}
887 />
888 );
889}

Callers

nothing calls this directly

Calls 2

useInsertPromptSegmentFunction · 0.85
insertFunction · 0.50

Tested by

no test coverage detected