Skip to content

Commit 03b20d0

Browse files
CopilotGermanJablo
andauthored
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

File tree

docs/custom-components/edit-view.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,9 @@ export const EditMenuItems = async (props: EditMenuItemsServerProps) => {
346346
import React from 'react'
347347
import { PopupList } from '@payloadcms/ui'
348348

349-
import type { EditViewMenuItemClientProps } from 'payload'
349+
import type { EditMenuItemsClientProps } from 'payload'
350350

351-
export const EditMenuItems = (props: EditViewMenuItemClientProps) => {
351+
export const EditMenuItems = (props: EditMenuItemsClientProps) => {
352352
const handleClick = () => {
353353
console.log('Custom button clicked!')
354354
}

0 commit comments

Comments
 (0)