diff --git a/src/components/popups/Coords.jsx b/src/components/popups/Coords.jsx index 34f93ff4a..2b43a51fa 100644 --- a/src/components/popups/Coords.jsx +++ b/src/components/popups/Coords.jsx @@ -17,16 +17,24 @@ export function Coords({ lat, lon }) { ) } -export function CopyCoords({ lat, lon }) { +/** + * + * @param {{ lat: number, lon: number } & import('@mui/material').MenuItemProps} props + * @returns + */ +export function CopyCoords({ lat, lon, onClick, ...props }) { const { t } = useTranslation() - const copy = React.useCallback( - () => navigator.clipboard.writeText(`${lat}, ${lon}`), - [lat, lon], + const onClickWithCopy = React.useCallback( + (/** @type {React.MouseEvent} */ e) => { + navigator.clipboard.writeText(`${lat}, ${lon}`) + if (onClick) onClick(e) + }, + [lat, lon, onClick], ) return ( - + {t('copy_coordinates')} ) diff --git a/src/features/station/StationPopup.jsx b/src/features/station/StationPopup.jsx index 87c3dcc33..000c6adca 100644 --- a/src/features/station/StationPopup.jsx +++ b/src/features/station/StationPopup.jsx @@ -196,7 +196,7 @@ function StationMenu({ {t(option.name)} ))} - {copyCoords && } + {copyCoords && } ) @@ -316,7 +316,7 @@ function StationMons({ id }) { return ( - {t('stationed_pokemon')} + {t('placed_pokemon')} {(index, mon) => {