export function ActionsStory()

in src/stories/ActionMenu.stories.tsx [50:84]


export function ActionsStory(): JSX.Element {
  const [option, setOption] = useState('Select an option')
  const onAction = (itemProps: ItemProps) => {
    setOption(itemProps.text ?? '')
  }
  return (
    <>
      <h1>Actions</h1>
      <h2>Last option activated: {option}</h2>
      <ErsatzOverlay>
        <ActionMenu
          onAction={onAction}
          anchorContent={<ServerIcon />}
          items={[
            {
              leadingVisual: ServerIcon,
              text: 'Open current Codespace',
              description:
                "Your existing Codespace will be opened to its previous state, and you'll be asked to manually switch to new-branch.",
              descriptionVariant: 'block',
              trailingText: '⌘O'
            },
            {
              leadingVisual: PlusCircleIcon,
              text: 'Create new Codespace',
              description: 'Create a brand new Codespace with a fresh image and checkout this branch.',
              descriptionVariant: 'block',
              trailingText: '⌘C'
            }
          ]}
        />
      </ErsatzOverlay>
    </>
  )
}