import * as React from 'react'; import { PrimaryButton } from 'office-ui-fabric-react/lib/Button'; import { IPersonaProps, IPersona } from 'office-ui-fabric-react/lib/Persona'; import { people } from '@uifabric/example-data'; import { SelectedPeopleList, ISelectedPeopleList, SelectedPersona, ItemWithContextMenu, TriggerOnContextMenu, copyToClipboard, } from '@uifabric/experiments/lib/SelectedItemsList'; export interface IPeopleSelectedItemsListExampleState { currentSelectedItems: IPersonaProps[]; } export class SelectedPeopleListWithContextMenuExample extends React.Component< {}, IPeopleSelectedItemsListExampleState > { private _selectionList: ISelectedPeopleList; /** * Build a custom selected item capable of being edited with a dropdown and * capable of editing */ private SelectedItem = ItemWithContextMenu({ menuItems: item => [ { key: 'remove', text: 'Remove', onClick: () => { this._selectionList.removeItems([item]); }, }, { key: 'copy', text: 'Copy', onClick: () => copyToClipboard(this._getCopyItemsText([item])), }, ], itemComponent: TriggerOnContextMenu(SelectedPersona), }); constructor(props: {}) { super(props); this.state = { currentSelectedItems: [people[40]], }; } public render(): JSX.Element { return (