Copilot commented on code in PR #3179:
URL: https://github.com/apache/apisix-dashboard/pull/3179#discussion_r2281673441
##########
src/components/Header/LanguageMenu.tsx:
##########
@@ -55,6 +55,13 @@ export const LanguageMenu = () => {
{Object.keys(LangMap).map((lang) => (
<Menu.Item
key={lang}
+ {...(lang === i18n.language && {
Review Comment:
[nitpick] The spread operator with conditional object creation creates
unclear code. Consider extracting this logic into a separate function or using
clearer conditional rendering for better readability.
##########
src/components/Header/LanguageMenu.tsx:
##########
@@ -55,6 +55,13 @@ export const LanguageMenu = () => {
{Object.keys(LangMap).map((lang) => (
<Menu.Item
key={lang}
+ {...(lang === i18n.language && {
+ disabled: true,
+ style: {
+ backgroundColor:
+ 'var(--menu-item-hover, var(--mantine-color-gray-1))',
Review Comment:
[nitpick] The CSS variable fallback chain 'var(--menu-item-hover,
var(--mantine-color-gray-1))' is hardcoded. Consider defining this as a
constant or using a theme utility function for better maintainability.
```suggestion
backgroundColor: MENU_ITEM_HOVER_BG,
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]