Copilot commented on code in PR #3134:
URL: https://github.com/apache/apisix-dashboard/pull/3134#discussion_r2176320670


##########
src/stores/global.ts:
##########
@@ -14,30 +14,18 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import { action, observable } from 'mobx';
-import { makePersistable } from 'mobx-persist-store';
+import { atom } from 'jotai';
+import { atomWithStorage } from 'jotai/utils';
 
-/** allow store use `set(key, value)` */
-const set = action(function <T, K extends keyof T>(
-  this: T,
-  key: K extends 'set' ? never : K,
-  value: T[K]
-) {
-  this[key as K] = value;
-});
+// Admin key with persistent storage
+export const adminKeyAtom = atomWithStorage<string>(
+  'settings:adminKey',
+  '',
+  undefined,

Review Comment:
   [nitpick] Passing `undefined` as the storage argument to `atomWithStorage` 
can be ambiguous. For clarity, explicitly pass `window.localStorage` or omit 
the parameter if default is desired.
   ```suggestion
   
   ```



##########
package.json:
##########
@@ -31,6 +31,7 @@
     "fast-clean": "^1.4.0",
     "i18next": "^25.0.1",
     "immer": "^10.1.1",
+    "jotai": "^2.12.5",
     "mobx": "^6.13.7",
     "mobx-persist-store": "^1.1.8",
     "mobx-react-lite": "^4.1.0",

Review Comment:
   MobX and related packages are no longer used; consider removing `mobx`, 
`mobx-persist-store`, and `mobx-react-lite` from dependencies to reduce bundle 
size.
   ```suggestion
   
   ```



-- 
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: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to