Repository: adobe/react-spectrum
File: packages/dev/s2-docs/src/CodePlatter.tsx (TypeScript)

Code before:
                    a.hidden = true;
                    document.body.appendChild(a);

                    a.click();
                    a.remove();
                  }}>
                  <Download />
                  <Text slot="label">Download ZIP</Text>
                </MenuItem>
              }
              {registryUrl &&
                <MenuItem onAction={() => setShowShadcn(true)}>
                  <Prompt />
                  <Text>Install with shadcn</Text>
                </MenuItem>
              }
              {files &&
                <MenuItem
                  onAction={async () => {
                    try {
                      let result = await createCodeSandbox(getExampleFiles(codeRef, files, urls, entry), deps, type, entry);
                      let url = `https://codesandbox.io/p/devbox/${result}`;
                      window.open(url, '_blank')?.focus();
                    } catch {
                      ToastQueue.negative('Failed to create CodeSandbox, make sure you are logged in to CodeSandbox. If you are already logged in, logout and log back in.');
                    }
                  }}>
                  <Polygon4 />
                  <Text slot="label">Open in CodeSandbox</Text>
                </MenuItem>
              }
              {files && type !== 's2' &&
                <MenuItem
                  onAction={() => {
                    createStackBlitz(getExampleFiles(codeRef, files, urls, entry), deps, type, entry);
                  }}>
                  <Flash />
                  <Text slot="label">Open in StackBlitz</Text>
                </MenuItem>
              }
              {/* registryUrl &&
                <MenuItem
                  href={`https://v0.dev/chat/api/open?url=${getBaseUrl('react-aria')}/registry/${registryUrl}`}
                  target="_blank"
                  rel="noopener noreferrer">
                  <V0 />
                  <Text>Open in v0</Text>
                </MenuItem>
              */}
            </Menu>
          </MenuTrigger>}

Review comment (suggestion):
I kind of like the idea of this being a Dialog. It's less harsh and there's more room to to explain what the user needs to do. And the primary action could do another check (with pending state) and open the link if it passes.

Code after:
                    a.download = 'example.zip';
                    a.hidden = true;
                    document.body.appendChild(a);

                    a.click();
                    a.remove();
                  }}>
                  <Download />
                  <Text slot="label">Download ZIP</Text>
                </MenuItem>
              }
              {registryUrl &&
                <MenuItem onAction={() => setShowShadcn(true)}>
                  <Prompt />
                  <Text>Install with shadcn</Text>
                </MenuItem>
              }
              {files &&
                <MenuItem
                  onAction={() => {
                    setShowCodeSandbox(true);
                  }}>
                  <Polygon4 />
                  <Text slot="label">Open in CodeSandbox</Text>
                </MenuItem>
              }
              {files && type !== 's2' &&
                <MenuItem
                  onAction={() => {
                    createStackBlitz(getExampleFiles(codeRef, files, urls, entry), deps, type, entry);
                  }}>
                  <Flash />
                  <Text slot="label">Open in StackBlitz</Text>
                </MenuItem>
              }
              {/* registryUrl &&
                <MenuItem
                  href={`https://v0.dev/chat/api/open?url=${getBaseUrl('react-aria')}/registry/${registryUrl}`}
                  target="_blank"
                  rel="noopener noreferrer">
                  <V0 />
                  <Text>Open in v0</Text>
                </MenuItem>
              */}
            </Menu>
          </MenuTrigger>}
        </ActionButtonGroup>
      </Toolbar>
      <div ref={codeRef}>
        {children}
      </div>