Browse Source

item.key === (currKey ?? initKey)

visuddhinanda 1 year ago
parent
commit
5735299262
1 changed files with 1 additions and 2 deletions
  1. 1 2
      dashboard-v4/dashboard/src/components/task/Options.tsx

+ 1 - 2
dashboard-v4/dashboard/src/components/task/Options.tsx

@@ -1,5 +1,4 @@
 import { Button, Dropdown, MenuProps } from "antd";
-import exp from "constants";
 import { useState } from "react";
 
 export interface IMenu {
@@ -16,7 +15,7 @@ interface IWidget {
 const Options = ({ items, icon, text, initKey = "1", onChange }: IWidget) => {
   const [currKey, setCurrKey] = useState(initKey);
   const currValue = items.find(
-    (item) => item.key === currKey ?? initKey
+    (item) => item.key === (currKey ?? initKey)
   )?.label;
   const onClick: MenuProps["onClick"] = ({ key }) => {
     if (onChange) {