Commit 03b20d0
docs: correct type name in editMenuItems client component example (#15904)
The `editMenuItems` client component example in
`docs/custom-components/edit-view.mdx` referenced a non-existent type
`EditViewMenuItemClientProps`. The correct exported type is
`EditMenuItemsClientProps`.
## Changes
- **`docs/custom-components/edit-view.mdx`**: Replace
`EditViewMenuItemClientProps` → `EditMenuItemsClientProps` in the client
component code example (import and props type annotation)
The server component example already correctly used
`EditMenuItemsServerProps`; the client example now follows the same
naming pattern:
```tsx
import type { EditMenuItemsClientProps } from 'payload'
export const EditMenuItems = (props: EditMenuItemsClientProps) => {
// ...
}
```
<!-- START COPILOT ORIGINAL PROMPT -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>Change EditViewMenuItemClientProps to
EditViewMenuItemsClientProps</issue_title>
> <issue_description># Documentation Issue
>
> The code example at _Edit View > Custom Components > editMenuItems >
Client Component_ refers to a type "`EditViewMenuItemClientProps`"
twice. This type doesn't exist, it should be
`EditViewMenuItem**s**ClientProps`.
>
> ```tsx
> 'use client'
>
> import React from 'react'
> import { PopupList } from '@payloadcms/ui'
>
> import type { EditViewMenuItemClientProps } from 'payload'
>
> export const EditMenuItems = (props: EditViewMenuItemClientProps) => {
> const handleClick = () => {
> console.log('Custom button clicked!')
> }
>
> return (
> <PopupList.ButtonGroup>
> <PopupList.Button onClick={handleClick}>
> Custom Edit Menu Item
> </PopupList.Button>
> <PopupList.Button onClick={handleClick}>
> Another Custom Edit Menu Item - add as many as you need!
> </PopupList.Button>
> </PopupList.ButtonGroup>
> )
> }
> ```
>
> The server component gets it right.</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> </comments>
>
</details>
<!-- START COPILOT CODING AGENT SUFFIX -->
- Fixes #15898
<!-- START COPILOT CODING AGENT TIPS -->
---
💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: GermanJablo <43938777+GermanJablo@users.noreply.github.com>1 parent 9bcedc8 commit 03b20d0
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
| 349 | + | |
350 | 350 | | |
351 | | - | |
| 351 | + | |
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| |||
0 commit comments