Skip to content

Commit

Permalink
fix: sonar cloud issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnsonMao committed Oct 3, 2024
1 parent 0a9083e commit ae02e71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
8 changes: 3 additions & 5 deletions components/shared/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export default function Tabs<T extends Key = string>({
tabs,
defaultActiveKey,
renderTabPaneContent,
}: TabsProps<T>) {
}: Readonly<TabsProps<T>>) {
const [activeKey, setActiveKey] = useState(
defaultActiveKey || tabs[0]?.tabKey
defaultActiveKey ?? tabs[0]?.tabKey
);
const activeTabItem = tabs.find((tab) => tab.tabKey === activeKey);

Expand All @@ -47,9 +47,7 @@ export default function Tabs<T extends Key = string>({
))}
</div>
<div role="tabpanel" aria-labelledby={`${activeTabItem?.label}`}>
{activeTabItem &&
renderTabPaneContent &&
renderTabPaneContent(activeTabItem)}
{activeTabItem && renderTabPaneContent?.(activeTabItem)}
</div>
</>
);
Expand Down
1 change: 0 additions & 1 deletion pages/rooms/[roomId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import RoomUserCardList from "@/components/rooms/RoomUserCardList";
import RoomButtonGroup from "@/components/rooms/RoomButtonGroup";
import RoomBreadcrumb from "@/components/rooms/RoomBreadcrumb";
import RoomChatroom from "@/components/rooms/RoomChatroom";
import GameWindow from "@/components/rooms/GameWindow";
import useRequest from "@/hooks/useRequest";
import useRoom from "@/hooks/useRoom";
Expand Down

0 comments on commit ae02e71

Please sign in to comment.